Open Source
10 items
10 items
The battle-tested coordination kernel that powers Kafka, HBase, and Hadoop with reliable distributed primitives
ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and group services. It exposes a simple API of znodes (like files in a filesystem) that clients use to build higher-level primitives like distributed locks, leader election, and barriers. ZooKeeper achieves high availability through replication and uses the Zab protocol (similar to Raft) for consensus. Its ordered, wait-free nature makes it ideal for coordination where correctness matters more than raw throughput.
ZooKeeper organizes data in a tree structure similar to a filesystem. Each node (znode) can store data (up to 1MB) and have children. This hierarchy naturally maps to configuration trees, service registries, and lock paths.
Ephemeral znodes are automatically deleted when the client session ends. This enables failure detection - if a service crashes, its ephemeral node disappears, triggering watches on other clients.
ZooKeeper can append a monotonically increasing counter to node names. This enables fair queuing and leader election - the client with the lowest sequence number becomes the leader.
ZooKeeper was created at Yahoo! Research to solve a common problem: distributed systems need coordination, but building coordination primitives correctly is extremely difficult. Every distributed application was reimplementing locks, leader election, and configuration management - often with subtle bugs.
ZooKeeper provides a small set of simple primitives that applications combine to build higher-level coordination:
The key insight: instead of providing these primitives directly, ZooKeeper provides a filesystem-like API with special properties (ordering, watches, ephemeral nodes) that make implementing them straightforward and correct.
Who uses ZooKeeper?