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

ZooKeeper, etcd & Paxos vs. Raft

Where coordination services fit in real architectures (and what NOT to put in them).

AdvancedPart of Distributed Consensus & Coordination
Practice in AI HLD
Subtopics in Distributed Consensus & Coordination (2)
OverviewRaft & Split-Brainetcd, ZooKeeper & Paxos

In plain words

Raft and Paxos are the math engines inside coordination vaults like etcd and ZooKeeper. You store tiny critical cluster facts in them (who is leader, config flags), NOT gigabytes of user photos.

Think of it like…

Air-traffic control tower: handles crucial runway permissions for planes, never hauls passenger luggage.

Loading interactive diagram
Loading interactive exercise

Theory & how it works

Paxos vs. Raft in practice

Paxos (and Multi-Paxos) was the classic foundation (used in Google Chubby & Spanner), famous for being subtle to implement cleanly. Raft was designed specifically to be understandable by decomposing consensus into Leader Election, Log Replication, and Safety - powering etcd (Kubernetes), CockroachDB, and TiKV.

Keep etcd / ZooKeeper datasets tiny (usually <8 GB) and backed by fast local NVMe SSDs so fsync latency stays under 10 ms.

Key points & practical guide

Summary checklist

  • etcd uses Raft; ZooKeeper uses ZAB; Spanner/Chubby use Multi-Paxos
  • Store only metadata, leases, and config - never bulk user traffic
  • Use ephemeral nodes/leases with TTLs for automatic dead-worker detection

When to use it

  • Leader election, service registry, feature flags, distributed locks

Watch out for

  • Putting high-QPS user session data into etcd - consensus disk fsyncs bottleneck quickly

Quick check

Loading quiz
Previous subtopic
Raft, Quorums & Preventing Split-Brain
Back to overview
Full Distributed Consensus & Coordination Lesson