PostgreSQL Cluster
A PostgreSQL Cluster refers to the entire collection of database servers (the Primary and all its Standbys) that work together to provide high availability and replication.
It's a way of grouping the machines that all share the same data.
What the "Cluster" Includes
Think of the cluster as the complete "team" responsible for handling your database workload:
- The Primary/Publisher: The one server that currently handles all the write traffic.
- The Standby(s)/Subscriber(s): The one or more servers that hold copies of the data, ready to take over or handle read traffic.
- The Configuration: All the shared settings, network rules, and the continuous WAL archiving that keeps the servers connected and synchronized.
- The HA Manager (e.g., Patroni): The separate program that constantly monitors the team and performs the automatic failover (promotion) if the Primary server fails.
Essentially, when a developer talks about the "database cluster," they aren't talking about just one server; they're talking about the system of two or more synchronized servers that act as a single, resilient unit.
Cluster vs. Single Server
- Single Server: If you have just one PostgreSQL database running, it's just an "instance."
- Cluster: If you have that instance, plus a Standby copy, and a manager watching them, that's a High Availability Cluster. The cluster's main job is to ensure the data is always available, even if one piece fails.
Published on: Oct 01, 2025, 02:32 AM