Why coordination is a small service

write = leader x majority x order

Consensus charges one leader, one majority round trip and one serialisation point per write, so buy it for small facts and keep everything that scales outside it.

A coordination service is a small, expensive ledger. Each write goes through one leader, waits for a majority to acknowledge it, and takes its place on one serialisation point. That cost is paid per operation, so the service earns its keep only on facts that are read constantly and rewritten rarely: which node leads, who holds a lock, which servers belong, and what the configuration says. Everything else belongs somewhere cheaper.

Think of the service as one ordered path. Every operation, read or write, enters the same serialisation point, so the system can process only what that path can carry. The service stores small metadata: which node is leader, which process holds a lock, who belongs to the group, and what the configuration says. Clients do not poll for these answers. They set watches on the keys they care about, and the service notifies them when a value changes. A membership change therefore reaches every interested client once, instead of every client asking again and again. The whole design rests on that pattern: small values, rare changes, and watches that replace polling. At a few thousand operations per second, the path has room for control traffic and very little else.

The abstraction hides the cost of data size. A store that answers in kilobytes feels like a database, so teams begin adding fields: request counters, queue payloads, per-user state. Each addition is one more operation through the same ordered path, and the path does not care whether the payload is a leader name or a megabyte blob. Consider a queue stored as znodes. Producers append messages, consumers take them, and every message passes the serialisation point twice. As traffic climbs toward the few thousand operations the service handles, the queue's bulk traffic delays the lock requests that elect leaders. Election slows, the control plane stalls, and every client waiting on a watch sees nothing change. The failure is not a crashed server. It is a metadata service that stopped carrying metadata, and it took routing down with it.

Decide before you write a key. Store it only if it is small, changes rarely, is read by many clients, and causes a safety violation rather than a delay when wrong. Membership, leader identity, shard assignment, and locks pass that test. Queues, counters, sessions, and request data fail it, so keep them in a system built for bulk writes. Use watches for every value that clients need to track, and never poll the service in a loop. Have clients carry the version they were given, so a stale answer becomes detectable. Where an answer will route a write, read through the leader or synchronise first. Review each key when its payload or write rate grows, and move anything that outgrows kilobytes.

orders of magnitude
Metadata per key
kilobytes

Leader identity, membership and configuration are small facts, and they are the only payloads the service is built to carry.

Bulk payload
megabytes

Queue messages, counters and request data run far larger, and they overload a path sized for metadata.

Client notification
watches

A client registers interest in a key and receives a change event, so membership changes reach it without polling.

Operation rate
a few thousand per second

Every operation passes one serialisation point, so this rate bounds the whole system.

field note

A coordination service looks like a convenient place for everything. Its API is simple and consistency is already solved, so engineers store queues, counters and per-request records there. The first version works because the data is small and the load is light.

The wall arrives as throughput. Every operation passes one ordered path, so bulk data turns the metadata service into the bottleneck for the whole system. Lock requests that elect leaders queue behind queue traffic, and a stall stops work everywhere that depends on it.

The ZooKeeper paper describes a small coordination kernel with watches, used for leader election, configuration and group membership. Clients watch keys instead of polling, and the metadata stays in kilobytes. The lesson is that consensus charges for every operation, so buy one serialisation point and keep everything that scales outside it.