Company
Date Published
Author
Lee Hampton
Word count
1300
Language
English
Hacker News points
None

Summary

We evaluated several third-party tools for high availability (HA) and automatic failover for PostgreSQL, a requirement for any reliable system. We looked for solutions that support streaming replication, different modes of replication, network partitions, operational simplicity, load balancing, cloud providers, containerized deployments, known consensus algorithms, manual management, community adoption, and permissive licenses. After evaluating several options, including Stolon and Patroni, we chose Patroni due to its simpler architecture, modular approach to load balancing, and ease of use. The core architecture of Patroni involves deploying a bot on each PostgreSQL node that manages the database and updates the distributed consensus system using etcd. This allows for leader election, health checks, and automatic failover in case of primary or replica failures.