Skip to main content
PostgreSQL cluster fault tolerance
Last update:

PostgreSQL cluster fault tolerance

By default, a PostgreSQL cloud database cluster consists of a single master-node. To provide fault tolerance to the cluster, you need to add replicas to the cluster.

Master Node

By default, a cluster consists of a single master node, the master. When connected to a master node, all operations are available: read (SELECT) and write (INSERT, UPDATE, DELETE, and others).

All data changes on the master node are duplicated on the replicas. The replication process does not affect the operation of replicas and the master node.

Replicas

Replicas are complete replicas of the master node. Available for read-only data (SELECT).

The presence of replicas in the cluster ensures its fault tolerance — if the master node stops working, its role will be taken over by one of the replicas and the cluster will continue to operate in normal mode. When the master node is restored, it will take over the role of the replica. This will change the address of the master node.

If there are no replicas in the cluster, it will be unavailable until the master node is restored. No data will be lost in the process.

We recommend creating fault-tolerant clusters with replicas or adding replicas to existing clusters.

Change the number of replicas

You can increase or decrease the number of replicas. When the number of replicas changes, the cluster continues to operate.

  1. In Control Panel, go to Cloud PlatformDatabases.
  2. Open the cluster page → Settings tab.
  3. Click Scale Cluster.
  4. Specify the new number of replicates. If there are no free addresses on the subnet to which the cluster is connected, a replica cannot be added — each new replica occupies a new address on the subnet.
  5. Click Save.