Coordination services
A small, strongly consistent store, usually three or five servers, that a distributed system uses to agree on who leads, who holds a lock and what the configuration is.
4 technologies on this page ↓How it works
When many machines share a job, they keep needing to agree on small facts: which copy is the leader, who holds a lock, which servers are alive, what the current settings are. A coordination service is a dedicated cluster, usually three or five servers, that answers those questions so that every client sees the same answer. The servers run a consensus protocol (Paxos in Google’s Chubby, Zab in ZooKeeper, Raft in etcd and Consul). One server is elected leader and every write goes through it. The leader adds the write to a replicated log and counts it as committed only once a majority, called a quorum, has stored it. Any two majorities share at least one server, so a committed write is never lost, and a minority cut off by a network split stops accepting writes instead of disagreeing. That is why clusters have an odd number of members: five servers survive two failures, and a sixth adds nothing. On top of the log sit a few primitives. Watches tell a client when a key changes, so it doesn’t poll. Leases and sessions tie a key to a client’s heartbeats, so an ephemeral key, such as a lock or an “I’m alive” record, disappears when its owner dies. Compare-and-set and sequential keys let many clients race for a lock and exactly one win. Every write is replicated through one leader and synced to disk, so these systems hold kilobytes to a few gigabytes of metadata, never your application’s data: etcd defaults to a 2 GiB quota and suggests 8 GiB at most, and ZooKeeper keeps everything in memory with each node capped just under 1 MB.
A club committee keeping the official minute book. A decision counts only once most members have signed it, so losing one or two members changes nothing, and two halves of a split committee can never both pass rules. The committee doesn’t store the club’s belongings, only who holds which key.
Reach for it when
- Electing one active leader among several copies of a service: a database primary, a scheduler, a controller
- Locks and leases for work that must happen in exactly one place at a time
- Small shared configuration and membership lists that many machines watch for changes
- Metadata for a bigger system, like Kubernetes objects in etcd or Vitess’s shard map
Think twice when
- Application data, large values or heavy write traffic: a few GB at most, and every write goes through one leader
- Caches and counters that can live with stale reads; a key-value store or cache is faster and scales out
- Lock-protected writes without a fencing token: a paused client can outlive its lease, so pass the lock’s revision (or ZooKeeper’s
zxid) to the storage and have it reject older ones
A real example
Three copies of a billing scheduler must never charge customers twice in one night. Each starts by trying to create the key /billing/leader in etcd, attached to a 10-second lease it keeps renewing. The one whose transaction succeeds runs the jobs; the other two watch the key. If the leader’s machine dies, its renewals stop, the lease expires within 10 seconds, the key disappears, and the watchers race again until one wins. The five-member etcd cluster underneath keeps working through the loss of any two members.
Technologies
Specific products, and what each does differently.
| Open source | Apache Software Foundation | Apache 2.0 | 2026-10-06 | |
| Open source | Cloud Native Computing Foundation | Apache 2.0 | 2026-10-06 | |
| Commercial product | HashiCorp, an IBM company | Business Source License 1.1 since 1.17 (source-available, not OSI open source); MPL 2.0 before the August 2023 change | 2026-10-05 |
Also used for coordination services
Products of other kinds that are often used this way, grouped by what they are.
| Actor model | Commercial product | Cloudflare, Inc. | Proprietary | 2026-10-12 |
What each provider calls it
- AWS
- No general-purpose coordination service. Amazon EKS runs etcd (three instances across three Availability Zones) inside each cluster’s control plane; Amazon MSK runs ZooKeeper for ZooKeeper-mode Kafka clusters; AWS Cloud Map for service discovery
- Google Cloud
- No standalone service. GKE keeps each cluster’s state in etcd on the control plane or in Spanner, managed for you; Service Directory for service discovery
- Azure
- No standalone service. AKS manages etcd in its control plane, and HDInsight uses ZooKeeper to elect the active head node
- Open source & others
- etcd (Apache 2.0, CNCF), Apache ZooKeeper with the Apache Curator client library, Consul (Business Source License since 1.17); Google’s Chubby is internal only
In code · bash
# every write gets a new cluster-wide revision number
etcdctl put /config/feature-x on
etcdctl get /config/feature-x -w json # shows mod_revision
# be told about changes instead of polling
etcdctl watch /config/ --prefix
# a key that vanishes when its owner stops renewing the lease
etcdctl lease grant 10 # lease 694d7bc81a3c5e2f granted with TTL(10s)
etcdctl put /members/worker-7 10.0.3.7 --lease=694d7bc81a3c5e2f
etcdctl lease keep-alive 694d7bc81a3c5e2f
# hold a named lock while a command runs
etcdctl lock nightly-billing ./charge-customers.shOften confused with
Where it came from1990–2025
In the late 1980s Leslie Lamport set out to prove that Echo, a fault-tolerant file system built at the SRC research lab, was trying to do the impossible: stay consistent through failures and keep working while any majority of its machines was up. Instead he found an algorithm that does exactly that, and described it as the parliament of an imaginary Greek island, Paxos. The paper, first submitted in 1990, appeared only in 1998. For years consensus stayed mostly academic, and each distributed system improvised its own failure handling.
In 2006 Google’s Mike Burrows described Chubby. Rather than ask every team to build Paxos into its programs, Google ran a small lock service, typically five replicas per cell, that also stored small files. GFS used a Chubby lock to appoint its master; Bigtable used Chubby to elect a master, find its servers and let clients find the master. Engineers at Yahoo built ZooKeeper for the same needs but chose a lower-level API: a tree of small data nodes with watches, “Chubby without the lock methods”, from which clients build their own locks, queues and elections. It came to Apache in 2008, was described in a 2010 paper, and became the coordination layer of the Hadoop generation, from HBase to Kafka.
In 2013 CoreOS announced etcd, a key-value store for shared configuration and service discovery, built on Raft, a consensus algorithm Diego Ongaro and John Ousterhout designed at Stanford to be easier to understand than Paxos and published in 2014. HashiCorp’s Consul, released in 2014, used Raft too. Kubernetes made etcd the store for all of its cluster state. Since then, some systems have absorbed consensus instead of depending on a separate service: Kafka 4.0 (2025) replaced ZooKeeper with its own Raft quorum.
Why it’s built this way
- A separate service instead of a consensus library in every program
- Chubby’s designers found that systems usually start as prototypes and need high availability only later. Taking a lock to become master took a couple of statements; restructuring an existing server to take part in a consensus protocol was far harder.
- Majority quorums and odd cluster sizes
- Any two majorities overlap, so a committed write survives failures and two halves of a split cluster can never both accept writes. Four members tolerate no more failures than three, so clusters run three, five or at most seven members.
- Watches and invalidations instead of polling or timeouts
- Chubby pushed invalidations to clients that cached data, and its developers liked not having to pick a cache timeout like DNS’s time-to-live. ZooKeeper’s watches let a client cache, say, the current leader and hear the moment it changes.
- Keys tied to a client’s heartbeats
- If a lock holder crashes, someone must notice and free the lock. Chubby sessions, ZooKeeper’s ephemeral nodes and etcd’s leases all delete a client’s keys when its keep-alives stop, which turns failure detection into a key disappearing.
Timeline
- 1990
Lamport submits “The Part-Time Parliament”, describing Paxos; it is published in 1998
- 2006
Google describes Chubby at OSDI
- 2008
ZooKeeper, built at Yahoo, comes to the Apache Software Foundation
- 2010
ZooKeeper paper at USENIX ATC; it becomes a top-level Apache project
- 2013
CoreOS announces etcd, built on Raft
- 2014
Raft paper at USENIX ATC; HashiCorp releases Consul
- 2020
etcd graduates in the CNCF
- 2025
Kafka 4.0 runs without ZooKeeper, on its own Raft quorum
- Leslie Lamport: The Part-Time Parliament (ACM TOCS, May 1998), with his note on its history
- Mike Burrows: The Chubby lock service for loosely-coupled distributed systems (OSDI 2006)
- Hunt, Konar, Junqueira, Reed: ZooKeeper, wait-free coordination for Internet-scale systems (USENIX ATC 2010)
- ASF Milestones: ZooKeeper arrives in 2008 and becomes a top-level project in 2010
- CoreOS blog: Distributed configuration data with etcd (Brandon Philips, July 2013) · archived copy, original
- Ongaro and Ousterhout: In search of an understandable consensus algorithm (USENIX ATC 2014)
- HashiCorp blog: Consul announcement (Armon Dadgar, Apr 2014)
- CNCF: Cloud Native Computing Foundation announces etcd graduation (Nov 2020)
- Apache Kafka 4.0.0 release announcement (Mar 2025)
- etcd docs: FAQ (odd cluster sizes, at most seven members)
Sources23
- Mike Burrows: The Chubby lock service (OSDI 2006 paper, PDF): five-replica cells, master leases, GFS and Bigtable
- ZooKeeper docs: Overview (leader, followers, majority, in-memory data)
- ZooKeeper docs: Programmer’s guide (ephemeral and sequential znodes, watches, data under 1 MB)
- ZooKeeper docs: Recipes (locks and leader election)
- ZooKeeper docs: Administrator’s guide (odd ensembles, jute.maxbuffer)
- etcd docs: FAQ (quorum, failure tolerance by cluster size)
- etcd docs: System limits (2 GiB default quota, 8 GiB suggested maximum)
- etcd docs: Why etcd (comparison with ZooKeeper and Consul)
- etcd docs: Tuning (100 ms heartbeat, 1000 ms election timeout)
- etcdctl README: put, get, watch, lease and lock commands
- Consul docs: Consensus (Raft)
- Consul docs: Sessions and distributed locks (inspired by Chubby)
- GitHub: hashicorp/consul LICENSE (BUSL 1.1 for Consul 1.17.0 and later)
- Martin Kleppmann: How to do distributed locking (Feb 2016), on fencing tokens
- Kubernetes docs: Cluster components (etcd holds all API server data)
- Vitess docs: Topology service (etcd, ZooKeeper or Consul)
- Amazon EKS User Guide: Architecture (three etcd instances across three Availability Zones)
- Amazon MSK Developer Guide: Metadata management (ZooKeeper and KRaft modes)
- AWS Cloud Map docs: What is AWS Cloud Map?
- Google Cloud: GKE cluster architecture (cluster state in etcd or Spanner)
- Google Cloud: Service Directory overview
- Microsoft Learn: Core concepts for AKS (etcd in the control plane)
- Microsoft Learn: HDInsight high availability components (ZooKeeper head node election)