Thought Toys · Computation & information · Exhibit 61

When the wire breaks, pick one

Two computers hold the same value and copy each other's writes. Break the wire between them and a distributed store can stay perfectly consistent or always available — never provably both. There's no cleverer protocol that dodges the choice.

Two replicas, A and B, holding the same key

Writes refused: 0Times A & B disagreed: 0

Policy — what does this system protect?
Network
Try it
your turn — break the link, then write to both sides under each policy

What you're seeing

A and B are two replicas of the same stored value, kept in sync by copying each other's writes. While the wire is connected, it doesn't matter which policy you pick — every write reaches both sides instantly, so nothing is ever refused and A and B always agree. The interesting part only starts once you break the link.

Switch to Consistency (CP) and write to either side: the write is refused. The system won't accept a change it can't confirm on both replicas, so A and B can never be caught disagreeing — the cost is paid in availability. Switch to Availability (AP) instead and write to both A and B with the link still broken: both writes succeed immediately, nothing is ever refused — but now read A and read B and they can give you different answers to the same question. That's not a bug in one policy; it's the same broken wire, forcing the same underlying choice, twice. Heal the link and the two replicas reconcile back to one agreed value — here, by simply keeping whichever side wrote most recently.

The rule, exactly. Formalized by Gilbert & Lynch (2002): in an asynchronous network that is subject to partitions, no algorithm can guarantee both Consistency (every read sees the latest write, or an error) and Availability (every request gets a non-error response) once a Partition actually occurs — you can only choose which one breaks. Verified in node (improve/verify/61-cap-theorem.js, 11 checks over hundreds of randomized operation sequences): with the link up, CP and AP are byte-for-byte identical — always available, always consistent; with the link down, CP refuses 100% of writes and 0% of reads ever disagree, while AP refuses 0% of anything and the replicas measurably diverge in the large majority of trials; and CP never diverges while partitioned, AP never refuses while partitioned — the two costs are exclusive, not a matter of writing better code. Negative control: re-run the exact same operation sequence with the link connected and CP and AP produce identical results in every trial — it's specifically the partition that forces the choice, not a flaw baked into either policy.

Also in Computation & information: Your computer can't hold one tenth →

All 20 in Computation & information
  1. 101Noise sets a speed limit, not an accuracy limit.
  2. 111Any party of six hides a trio
  3. 120How one bit of ink makes a grey
  4. 125The ambulance that arrives sooner by going slower
  5. 131Every number is a sum of Fibonacci numbers
  6. 23Sorting algorithms
  7. 24PageRank & the random surfer
  8. 25Huffman coding
  9. 26Dijkstra's shortest path
  10. 33The learning-rate cliff
  11. 36A* pathfinding
  12. 44Diffie–Hellman key exchange
  13. 49Freeze too fast, stay stuck
  14. 56Catch one error, miss the next
  15. 57Why more processors stop helping
  16. 58Why a busy line explodes
  17. 59The set that's only sure when it says no
  18. 60The fit that memorizes instead of learns
  19. 61When the wire breaks, pick one — you are here
  20. 82Your computer can't hold one tenth

← the cabinet · Thought Toys — a cabinet of explorable explanations. Exhibit 61.