Skip to content

Commit bb9e170

Browse files
committed
Extended description of architecture
1 parent ec65c80 commit bb9e170

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/solutions/high-availability.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
PostgreSQL has been widely adopted as a modern, high-performance transactional database. A highly available PostgreSQL cluster can withstand failures caused by network outages, resource saturation, hardware failures, operating system crashes or unexpected reboots. Such cluster is often a critical component of the enterprise application landscape, where [four nines of availability :octicons-link-external-16:](https://en.wikipedia.org/wiki/High_availability#Percentage_calculation) is a minimum requirement.
44

5-
There are several methods to achieve high availability in PostgreSQL. This solution document provides [Patroni](#patroni) - the open-source extension to facilitate and manage the deployment of high availability in PostgreSQL.
5+
There are several methods to achieve high availability in PostgreSQL. In this solution document we recommend the architecture using [Patroni](#patroni) - an open-source tool that automates the deployment of high availability in PostgreSQL using a distributed configuration store like etcd, Consul, ZooKeeper and Kubernetes.
6+
7+
We'll use [etcd :octicons-link-external-16:](https://etcd.io/docs/v3.3/learning/why/) as the most popular and preferred configuration store due to its simplicity, strong consistency, and reliability. We'll also add [`pgBackRest` :octicons-link-external-16:](https://pgbackrest.org/) - a reliable, easy-to-use backup and restore solution that can seamlessly scale up to the largest databases and workloads by utilizing algorithms that are optimized for database-specific requirements.
68

79
??? admonition "High availability methods"
810

@@ -70,6 +72,7 @@ The following diagram shows the architecture of a three-node PostgreSQL cluster
7072
The components in this architecture are:
7173

7274
- PostgreSQL nodes
75+
7376
- Patroni - a template for configuring a highly available PostgreSQL cluster.
7477

7578
- etcd - a Distributed Configuration store that stores the state of the PostgreSQL cluster.
@@ -82,12 +85,14 @@ The components in this architecture are:
8285

8386
### How components work together
8487

85-
Each PostgreSQL instance in the cluster maintains consistency with other members through streaming replication. Each instance hosts Patroni - a cluster manager that monitors the cluster health. Patroni relies on the operational etcd cluster to store the cluster configuration and sensitive data about the cluster health there.
88+
Each PostgreSQL instance in the cluster maintains consistency with other members through streaming replication. Each instance hosts Patroni - a cluster manager that monitors the cluster health. Patroni relies on the operational etcd cluster where it stores the cluster configuration and sensitive data about the cluster health.
8689

8790
Patroni periodically sends heartbeat requests with the cluster status to etcd. etcd writes this information to disk and sends the response back to Patroni. If the current primary fails to renew its status as leader within the specified timeout, Patroni updates the state change in etcd, which uses this information to elect the new primary and keep the cluster up and running.
8891

8992
The connections to the cluster do not happen directly to the database nodes but are routed via a connection proxy like HAProxy. This proxy determines the active node by querying the Patroni REST API.
9093

94+
95+
9196
## Next steps
9297

9398
[Deploy on Debian or Ubuntu](ha-setup-apt.md){.md-button}

0 commit comments

Comments
 (0)