Skip to content
jtoghrul, home

Visual proofs

CAP: the choice a partition forces

Distributed systems · Intro

When the network splits, a replicated system must either refuse some requests or risk returning stale data; it cannot be both consistent and available.

Try this

Cut the link, write to A, then try both answers at B. There is no third button.

Why it matters

Every distributed database documents which side it takes. Knowing the precise statement stops "pick two" from becoming a slogan.

The proof

Take two replicas, A and B, and cut the link between them. A client writes a new value to A. A cannot tell B.

Another client now reads from B. B has two options: answer with what it has, which is the old value, or refuse until it can check with A.

Answering keeps the system available but breaks consistency (a read after a completed write returned old data). Refusing keeps it consistent but not available.

That is the theorem Gilbert and Lynch proved. It says nothing about the normal case: with no partition, a system can be both. "Pick two of three" is a simplification; the real choice only happens during a partition.

Sources

  • Towards Robust Distributed Systems (keynote), Eric Brewer, 2000
  • Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services, S. Gilbert, N. Lynch, 2002