Skip to main content

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

Covered by Problems

ProblemDifficultyLink
Distributed CacheMedium
Web CrawlerHard
Ad Click AggregatorHard

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