PostgreSQL Connection Pooling
Choose by session state, connection origin, and deployment model. Check your ORM’s connection requirements before migrations.
Direct connection
Long-lived / MigrationsMigrations, long-lived backends, and workloads that rely on session state.
Note: Each connection consumes a database connection slot.
Session pool
Full session stateClients that need session state across transactions.
Note: A server connection remains assigned for the client session.
Transaction pool
High concurrencyHigh-concurrency short transactions, such as serverless APIs.
Note: Revisit cross-transaction SET, temporary objects, and session locks. Check prepared statements against the driver and pooler.
Popular poolers & official docs
PgBouncerLightweight proxy
For self-hosting, check feature support and protocol-level prepared statements by mode.
Pgpool-IIPooling + HA
Review deployment modes when pooling, read balancing and failover are required together.
SupabaseManaged Supavisor
Choose an endpoint by network reachability, connection limits, and transaction-pool prepared-statement restrictions.