The Desi Architect
Notes / Building Blocks / Replication and Leader Election
Track 2 · Building Blocks

Replication and Leader Election

Keep copies of your data on more than one machine, let exactly one machine take the writes, and have a safe way to pick a new one when it dies. This page covers how the copies stay in step, how Raft picks a leader, and why a stale leader is still dangerous.

Guide22 min read
On this page
  1. The night the primary went quiet
  2. The simple version
  3. How single-leader replication works
  4. Failure detection: how do you know the leader is dead?
  5. Raft in plain words
  6. Split-brain, and what Raft really guarantees
  7. Failover managers that are not Raft themselves
  8. What the real systems do
  9. Other ways to replicate
  10. The war room: flapping failovers at Tatkal time
  11. How to choose