Comply with the authentication policy for database access: Use managed identity authentication.
Support high-concurrency requests with minimal latency: Use a connection pooling library.
Protect database stability during traffic spikes: Configure maximum pool size.
The Recommendation API should use managed identity authentication because Fabrikam explicitly requires service-to-database authentication without long-lived credentials. Azure Container Apps managed identities allow applications to obtain Microsoft Entra tokens at runtime and access supported Azure resources without storing usernames, passwords, or connection secrets in application configuration.
For high-concurrency PostgreSQL access, implement a connection pooling library . Azure Database for PostgreSQL documentation recommends connection pooling because repeatedly opening new database connections creates backend processes and consumes CPU and memory. Reusing existing connections reduces connection-establishment overhead and improves latency and throughput. Azure also provides PgBouncer as a built-in pooling option for Flexible Server.
To protect PostgreSQL during sudden traffic spikes, configure a maximum pool size . An unlimited pool can allow application demand to create excessive concurrent connections, which can exhaust database memory and increase contention. Microsoft warns that increasing connection counts can cause significant performance degradation and recommends conservative connection limits combined with pooling.
Therefore, the optimal configuration combines managed identity + connection pooling + bounded pool size .
Study Guide references: Azure Container Apps managed identities; Azure Database for PostgreSQL connection management; PgBouncer; connection-pool sizing and resource protection.