It keeps track of changes in the Master/Slave nodes and connects to the appropriate master node when the clients request connection. It becomes difficult to maintain the database end points in this situation.
With this high availability solution which has more than one database instances in a single cluster, the master node of the cluster keeps changing in case of any failure. With this information, ETCD elects the master node and keeps the cluster UP and running. Whenever there is a change in the state of any PostgreSQL node in the cluster, Patroni updates the state change in the ETCD key-value store. It gracefully handles leader elections during network partitions and can tolerate machine failure, even in the leader node. It is also capable of handling Database replication, backup and restoration configurations.ĮTCD is a fault-tolerant, distributed key-value store that is used to store the state of the PostgreSQL cluster. Patroni is a template for you to create your own customized, high-availability solution developed using Python. In this tutorial, you’ll set up the PostgreSQL with high availability using Patroni, ETCD and HAProxy. There are other open source frameworks available which can be used to manage high availability of the PostgreSQL Database. It is highly robust and versatile, but doesn’t have features for the high availability. PostgreSQL is an opensource relational database that can run on major operating systems.