0Pricing
Advanced PostgreSQL: Indexing, Partitioning, Replication · Lesson

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

  1. Automatic Failover Tools (Patroni)
  2. Monitoring Replication Health
  3. Disaster Recovery Strategies
  4. Connection Routing with PgBouncer and HAProxy
← Back to Advanced PostgreSQL: Indexing, Partitioning, Replication