From "Designing Data-Intensive Applications"
🎧 Listen to Summary
Free 10-min PreviewSynchronous 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.