ZooKeeper and ZAB
ZooKeeper (Apache, 2010): distributed coordination service for leader election, distributed locks, service discovery, configuration management.
ZAB (ZooKeeper Atomic Broadcast): consensus protocol used by ZooKeeper.
- Similar to Multi-Paxos but designed specifically for primary-backup replication
- Epoch-based: each epoch has one primary; primaries are ordered by epoch number
- Two phases: discovery (establish new epoch) + synchronization + broadcast
- Ordered delivery: all updates are delivered in FIFO order from the primary
ZAB guarantees sequential consistency (not linearizability) — read from any replica may be stale; sync() required before a linearizable read.