Postgres High-Availability Patterns
Postgres HA in 2026 is more achievable than ever. Four patterns; pick on team and scale.
Why HA matters
Postgres single-node: any node failure = downtime.
HA: standby ready; failover in seconds-minutes.
Four patterns
- 1. Streaming replication + manual failover.
- 2. Patroni-managed cluster.
- 3. Stolon, pg_auto_failover.
- 4. Managed (RDS, Cloud SQL, Aurora).
Failover behavior
Streaming replication: 1-15 minute manual failover.
Patroni/Stolon: 30 seconds automatic.
Managed: 30 seconds automatic; provider-handled.
When managed wins
At small-mid scale (sub-1TB), managed is usually right.
At scale, Patroni gives more control; pay the ops cost knowingly.
Antipatterns
- Single-node forever. Outage waiting.
- Managed without backup verification. Surprise on real failover.
- Custom HA without Patroni. Reinvent the wheel badly.
What to do this week
Three moves. (1) Apply this pattern to your most-loaded table. (2) Measure query latency / write throughput before/after. (3) Document the win and the constraint so the next refactor inherits the knowledge.