...

/

Primary-Backup Replication Algorithm

Primary-Backup Replication Algorithm

Learn about primary-backup replication, and its practical application, advantages, and disadvantages.

Primary-backup replication

Primary-backup replication is a technique where we designate a single node amongst the replicas as the leader, or primary, that receives all the updates.

This technique is also known as single-master replication.

We commonly refer to the remaining replicas as followers or secondaries. These can only handle read requests. Every time the leader receives an update, it executes it locally and also propagates the update to the other nodes. This ensures that all the replicas maintain a consistent view of the data.

Techniques for propagating updates

There are two ways to propagate the updates: synchronously and asynchronously.

Synchronous replication

In synchronous replication, the node replies to the client to indicate the update is complete—only after receiving acknowledgments from the other replicas that they’ve also performed the update on their local storage. This ...