Cover of Designing Data-Intensive Applications by Martin Kleppmann - Business and Economics Book

From "Designing Data-Intensive Applications"

Author: Martin Kleppmann
Publisher: "O'Reilly Media, Inc."
Year: 2017
Category: Computers

🎧 Free Preview Complete

You've listened to your free 10-minute preview.
Sign up free to continue listening to the full summary.

🎧 Listen to Summary

Free 10-min Preview
0:00
Speed:
10:00 free remaining
Chapter 5: Replication
Key Insight 3 from this chapter

Synchronous vs. Asynchronous Replication

Key Insight

A critical design choice in replicated systems is whether replication occurs synchronously or asynchronously. With synchronous replication, the leader withholds success notification to a client until a designated follower has confirmed receipt of the write. This guarantees that the follower possesses an identical, up-to-date copy of the data, providing immediate data availability on the follower in the event of leader failure.

The primary drawback of fully synchronous replication is its susceptibility to outages or slowdowns of any synchronous follower, which can block all writes and halt the entire system. For this reason, it's typically configured as semi-synchronous, where only one follower is synchronous and the rest are asynchronous, ensuring at least two nodes (leader and one follower) have the latest data. Conversely, asynchronous replication allows the leader to process subsequent writes without awaiting follower acknowledgment, maximizing write throughput even if followers fall behind.

The trade-off for asynchronous replication's speed and fault tolerance is potential data loss: if the leader fails before writes are replicated, those writes are permanently lost, compromising durability. While replication lag is often mere seconds, it can extend to minutes during high load or network issues, leading to inconsistencies. Despite this risk, asynchronous replication is widely favored, particularly in systems with numerous or geographically dispersed followers, where the performance and availability benefits often outweigh the weakened durability guarantee.

📚 Continue Your Learning Journey — No Payment Required

Access the complete Designing Data-Intensive Applications summary with audio narration, key takeaways, and actionable insights from Martin Kleppmann.