ZooKeeper / Distributed Coordination
Difficulty: Hard | Topic #31
What to Learn
Leader election, distributed configuration management, service registry, ephemeral nodes, watch mechanisms; when ZooKeeper is overkill vs when it's necessary.
Resources
- Hello Interview: ZooKeeper Deep Dive ↗
- Gaurav Sen: Introduction to Apache ZooKeeper ↗
- Arpit Bhayani: GitHub Outage — How Databases Are Managed in Production ↗
Covered by Problems
| Problem | Difficulty | Link |
|---|---|---|
| Distributed Cache | Medium | → |
| Web Crawler | Hard | → |
| Ad Click Aggregator | Hard | → |
Key Concepts to Master
- ZooKeeper znodes — persistent vs ephemeral and how ephemeral nodes detect crashes
- Watches — one-time notifications when a znode changes
- Leader election recipe using sequential ephemeral znodes
- Quorum-based writes for consistency (ZAB protocol)
- When etcd or Consul is a better modern alternative