Connection Routing with PgBouncer and HAProxy
Route clients to the current primary and balance read traffic across replicas to keep applications available through failovers.
The Routing Problem
After a failover the primary moves to a new host. Applications need a stable endpoint so they do not have to be reconfigured each time. Connection routing solves this.
PgBouncer Basics
PgBouncer is a lightweight connection pooler. It multiplexes many client connections onto a small set of server connections, reducing backend load.
All lessons in this course
- Automatic Failover Tools (Patroni)
- Monitoring Replication Health
- Disaster Recovery Strategies
- Connection Routing with PgBouncer and HAProxy