CSE Roadmap

Core tier · about 3 hours · 6 parts

Part 3 of 6 · 2 min read

Why "pick two of three" misleads

Partitions are not a choice, and the formal definitions are narrow.

Think of a restaurant menu that says "choose any two: fast, cheap, good". If one item on the list is "the sea does not flood the kitchen", you cannot really choose that. It will happen or it will not.

The DDIA book argues that the popular phrasing is misleading. Network partitions are a kind of fault, so they are not something a designer can choose to have or not. They happen anyway. When the network works, a system can provide both consistency and total availability. When a fault occurs, it must choose. The book suggests the better wording "either consistent or available when partitioned". A more reliable network makes the choice necessary less often, but not never.

More points from the same book:

  • CAP began as a rule of thumb in 2000 (named by Eric Brewer), without exact definitions. It encouraged designers to explore systems that are not built around shared storage, and gets credit for the surge of new database types since the mid-2000s.
  • The formal theorem has a narrow scope. It covers one consistency model (linearizability, module 6) and one fault (a network partition). It says nothing about network delays, dead nodes or other trade-offs.
  • Its definition of availability does not match the everyday one. Many systems called highly available do not meet the theorem's meaning.
  • A footnote advises avoiding the CP and AP labels, because the scheme has flaws.
  • The book's verdict: CAP has little practical value for designing systems and is mostly of historical interest, superseded by more precise results.

The interview book still uses the labels in a design discussion, as a way to start the conversation with the interviewer. Both views are useful. In an interview, state the choice per feature in plain words (what the user sees during a partition) and avoid presenting CAP as a switch with three positions.

Common mistake

Saying "we chose CA" or "we picked two of the three". There is no real-world CA choice. The honest statement is what the system does when the network splits.

Another point of caution is that CAP says nothing about everything else users feel. A system that is never partitioned can still be slow, and that is the next section.

Check yourself:

  • Why is partition tolerance not a free choice?
  • Name two things the formal CAP theorem does not cover.