Search⌘ K
AI Features

Primary-Backup Replication Algorithm

Explore the primary-backup replication algorithm used in distributed systems to maintain data consistency. Understand the roles of leader and follower nodes, differences between synchronous and asynchronous replication, and the trade-offs involved in scalability, durability, and performance. Learn about failover management and its challenges in replicating data reliably.

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 ...