Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
All topics/Distributed Consensus & Coordination
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
Practice in AI HLD
Subtopics in Distributed Consensus & Coordination (2)
OverviewRaft & Split-Brainetcd, ZooKeeper & Paxos

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
Parent topic
Distributed Consensus & Coordination
Next subtopic
ZooKeeper, etcd & Paxos vs. Raft