DISTRIBUTED SYSTEMS & ARCHITECTURE · SUBTOPIC
Raft, Quorums & Preventing Split-Brain
Understand terms, randomized election timers, and why minority partitions cannot elect a second leader.
AdvancedPart of Distributed Consensus & Coordination
Subtopics in Distributed Consensus & Coordination (2)
In plain words
If a club needs more than half the members to vote for president, two separate rooms can NEVER both elect a different president at the same time.
Think of it like…
Passing a board resolution requires >50% of all seats; two rogue members locked in a closet cannot vote themselves in charge.
Loading interactive diagram
Loading interactive exercise
Theory & how it works
Randomized timeouts prevent election ties
If all followers timed out at 500 ms together and voted for themselves simultaneously, elections could deadlock forever. Raft gives each follower a random timeout (e.g., 150–300 ms) so one node wakes up first, asks for votes, and wins cleanly.
Key points & practical guide
Summary checklist
- Majority quorum = ⌊N/2⌋ + 1
- Use 3 or 5 nodes across 3 Availability Zones
- Use etcd/ZooKeeper for metadata & config, NOT high-volume user data
When to use it
- Cluster coordination, config stores, service discovery, distributed locks
Watch out for
- Running an even-numbered 4-node Raft cluster (same fault tolerance of 1 failure as 3 nodes, with higher write cost!)
Quick check
Loading quiz