A web application opens and closes thousands of short database sessions every minute against an Azure Database for PostgreSQL flexible server, and the server keeps hitting its connection limit. Which technique reduces this overhead?
Show answer and explanation
Answer: A
Connection pooling with PgBouncer keeps a set of server connections open and hands them to clients as they need them. Opening a PostgreSQL connection is relatively expensive, and each one consumes server memory, so a small reusable pool lets many short-lived client sessions share fewer real backend connections. This eases connection exhaustion and reduces latency for brief requests.
Why the other options are wrong
- B. Standby replicas serve failover and read traffic. Writes cannot be sent to them, and routing to them would not reduce connection setup cost.
- C. TLS certificates secure the channel. They do not reduce how many sessions the server must create or hold.
- D. Result caching avoids re-running queries, but it does not reduce the number of connections the server must open and manage.