Search⌘ K
AI Features

Replication Types and Node Outages

Explore the differences between synchronous and asynchronous replication in distributed systems and understand how to manage temporary and permanent node outages effectively. Learn about failover processes and hybrid replication approaches to maintain data integrity and system availability during leader or follower failures.

Now that we have a basic understanding of replication, let’s discuss replication mechanisms and outages.

Just like in the previous lessons, let’s assume that the My Cool App has a good amount of data, but all the data can be hosted on a single machine. Now we want to build replication mechanisms so that the database system can scale and can handle more load.

Synchronous or asynchronous replication?

When a leader receives some data to write, should the replication happen synchronously or asynchronously?

Note: In synchronous replication, a write is successful only when all the followers have successfully processed the write-request. In asynchronous replication, a write is successful as soon as the leader has processed the write-request, after which the followers can process it asynchronously.

Timeline of a synchronous replication based system
Timeline of a synchronous replication based system

Synchronous replication guarantees that every follower in the system contains the same up-to-date data as the leader. If the leader fails, data is already available to the followers—so no write is lost.

In the above diagram, we see a visualization of synchronous replication. Upon receiving a write-request, a leader processes it in itself, then triggers the same to the followers. To report whether the write was successful, the leader waits for both followers to report that ...