A shared source of truth
Many coordination patterns reduce to one need, a small piece of state that every node agrees on. A coordination service in the Zookeeper style provides a tree of data nodes, kept consistent across a small ensemble of servers, that clients read and write to coordinate.
The data model
The tree looks like a filesystem. Each path holds a little data and may have children.
- Persistent nodes stay until explicitly deleted.
- Ephemeral nodes vanish when the client that made them disconnects.
- Sequential nodes get a monotonically increasing number appended to their name.
The service keeps a quorum of servers in sync so reads return agreed values. Writes go through a leader and are committed only when a majority acknowledges.
Why it helps
Locks, leader election, and group membership all become simple tree operations. To elect a leader, every candidate creates a sequential ephemeral node and the lowest number wins. If that client dies, its node disappears and the next number takes over.
Key idea
A Zookeeper style service offers a small consistent tree with persistent, ephemeral, and sequential nodes, turning hard coordination problems into simple ordered tree operations backed by majority agreement.