DBRaven
Relationship · Mitigates
Source: Pattern·Target: Failure Mode

Summary

A connection pool bounds the total database connections an application can open, preventing connection storms during traffic spikes and protecting the database server from exceeding its connection limit.

Evidence

  • ·PgBouncer reduces PostgreSQL connections by 10–100x in typical deployments
  • ·Connection exhaustion incidents are almost entirely eliminated with pooling
  • ·PostgreSQL defaults to max_connections=100; pooling allows thousands of app instances

Operational Context

  • ·PgBouncer transaction-mode pooling is most effective for stateless APIs
  • ·Session-mode pooling required for applications using SET LOCAL or advisory locks
  • ·Pool size should be tuned to database server core count, not application replica count

Tradeoffs

  • ·Pooler becomes a new single point of failure if not replicated
  • ·Transaction-mode pooling incompatible with LISTEN/NOTIFY or explicit transactions across requests
  • ·Pool saturation under extreme load shifts the bottleneck to the pool queue

Generator Relevance

Connection pooling should be included in all generated PostgreSQL architectures serving more than a handful of application replicas.

Evidence grounding

Grounded, 3 supporting items

Connection pooling is the canonical solution to connection exhaustion. PgBouncer and application-level pools are standard operational practice.

connection_pooling mitigates connection_exhaustion: DBRaven