Connection pooling reuses a small set of database connections across many client requests, instead of opening a new connection per request. PostgreSQL connections are expensive (each is a separate process using significant memory), so pooling is essential for performance and scalability under load. PgBouncer is the standard pooler.
The problem: PostgreSQL connections are expensive
Each PostgreSQL connection = a separate OS PROCESS, using ~5-10MB of memory.
✗ Opening a connection has overhead (process creation, auth, setup)
✗ Many connections (e.g. 1000s from a busy app) → huge memory use, contention
✗ Postgres has a max_connections limit (often ~100); exceeding it = errors
→ Opening/closing a connection per request, or holding thousands open, doesn't scale.
