CAP Theorem
Summary: A theorem describing the fundamental trade-off between consistency and availability in a distributed system during a network partition.
Sources: chapter9
Last updated: 2026-04-17
The CAP theorem (Consistency, Availability, and Partition tolerance) was proposed by Eric Brewer in 2000 (source: chapter9, p. 337). It is often misunderstood as “pick two out of three,” which is misleading (source: chapter9, p. 337).
The Real Trade-Off
A network partition is a kind of fault, so you don’t have a choice; you must decide how the system should behave when it happens (source: chapter9, p. 337).
- Consistency (Linearizability): If you require linearizability and some replicas are disconnected due to a network problem, they cannot process requests and must return an error. The system becomes unavailable (source: chapter9, p. 336).
- Availability: If the system does not require linearizability, replicas can process requests independently, even if they are disconnected from others. The system remains available, but its behavior is not linearizable (source: chapter9, p. 336).
Limitations of CAP
- Consistency: In CAP, “Consistency” specifically means linearizability (source: chapter9, p. 337). This is different from the “Consistency” in acid (source: chapter9, p. 337).
- Availability: CAP uses a narrow definition of availability (every node that is alive must respond) (source: chapter9, p. 337).
- Partitions: It only considers one type of fault: a network partition (source: chapter9, p. 337).
PACELC Theorem
Because of these limitations, many distributed systems researchers prefer the PACELC theorem, which extends CAP by also considering the trade-off between latency and consistency even when no partition is present (source: chapter9, p. 337, footnote).