ZooKeeper
The distributed coordination service that keeps your distributed systems in sync. ZooKeeper provides the primitives — leader election, locks, configuration, service discovery — so you don't have to build them (incorrectly) yourself.
The Coordination Problem
Why distributed coordination is fundamentally hard — two generals, unreliable networks, clock skew — and why you shouldn't build it yourself.
Architecture & The Ensemble
Leader/follower ensemble, Zab protocol, quorum mechanics, and the write path through the cluster.
ZNodes & The Data Model
Hierarchical namespace, persistent vs ephemeral vs sequential nodes, and the stat structure.
Sessions & Watches
Client sessions, heartbeats, timeout negotiation, and the watch notification mechanism.
Coordination Patterns
Leader election, distributed locks, service discovery, config management, barriers — the recipes that make ZooKeeper useful.
Consistency Guarantees
Sequential consistency, atomicity, zxid ordering, what ZooKeeper promises and what it doesn't.
Operations & Four Letter Words
Deployment configuration, monitoring, JVM tuning, failure scenarios, and the admin commands.
Security
ACLs, authentication schemes, TLS encryption, and network security best practices.
ZooKeeper vs Alternatives
etcd, Consul, Apache Curator — when to use each and how they compare in system design interviews.
Why ZooKeeper?
Every distributed system needs coordination — leader election, configuration management, service discovery, distributed locking. ZooKeeper provides these as battle-tested primitives used by Kafka, HBase, Hadoop, and Solr in production at massive scale.
- ✓Coordination primitives — leader election, locks, barriers, and service discovery out of the box.
- ✓Strong ordering guarantees — all updates are totally ordered with global transaction IDs (zxid).
- ✓Ephemeral nodes — automatically detect failures and clean up state when clients disconnect.
- ✓Watch mechanism — get notified of changes instantly without polling.
- ✓Battle-tested — powers Kafka's controller, HBase's master election, and Hadoop YARN at scale.