IT lexicon › Database › Connection pooling (DB)

Connection pooling (DB)

Database På svenska → Updated: 2026-05-28

The technique of reusing a limited number of database connections for many clients, instead of opening a new connection per request. Essential for PostgreSQL, where each connection is its own process with heavy memory overhead.

The problem: PostgreSQL creates an OS process per connection (~5-10 MB each) → thousands of connections kill the server. A pooler (PgBouncer, Pgpool, or built into the driver) holds e.g. 20 physical connections and multiplexes thousands of clients over them. Modes: session (a client binds a connection for the whole session), transaction (the connection is returned after each transaction — highest reuse but breaks features like prepared statements/temp tables), statement. Serverless + pooling: a notorious trap (each lambda instance opens connections) → the need for a pooler like Supabase/Neon's. PgBouncer in transaction mode is the de facto standard.

← Back to the lexicon