NotesSystem

etcd

Also: etcd v3

A Raft-replicated key-value store for coordination data, best known as Kubernetes' backing store. Every change gets a global revision number.

Also in: Consensus › In the real world · Consistency Models › In the real world

Design choices

  • Raft: writes go through the leader and commit on a majority. Defaults: 100 ms heartbeat, 1,000 ms election timeout (at least 10× member round-trip time recommended, 50 s maximum), PreVote enabled.
  • Linearizability: reads are linearizable by default (the leader confirms it still leads); a serializable read is served locally and may be stale.
  • MVCC revisions: every write bumps a cluster-wide revision; watches can resume from a revision; a lock key's revision works as a Fencing Token.
  • Leases: keys attached to a TTL lease vanish when it expires; used for locks and Leader Election.
  • Cluster sizes: odd, usually 3 or 5; its FAQ advises no more than seven members.

Notable trade-offs

  • Jepsen (2020, v3.4.3): key-value operations strict serializable, but locks unsafe without fencing (two holders at once, even in healthy clusters).
  • Small data, modest write rates: it's a coordination store, not a general database.
  • v3.6.0 (May 2025) was the first minor release since v3.5.0 in 2021.