CAP: The Real Meaning of Trade-Offs
Brewer's CAP theorem proves that in an asynchronous network subject to partitions (where messages can be dropped or delayed), a distributed state machine can guarantee at most two of Consistency (linearizable reads), Availability (non-error responses from every non-failing node), and Partition Tolerance.
- Partition Tolerance (P) is mandatory: Physical networks and routers will experience dropped packets and severed links.
- CP Systems (e.g. Spanner, Raft clusters): Reject or delay writes during partitions to preserve absolute consistency.
- AP Systems (e.g. Cassandra, DynamoDB): Accept writes and return stale reads during partitions, resolving divergence later.
PACELC: When the Network is Healthy
CAP only describes behavior during a network partition. PACELC completes the model: If there is a Partition (P), choose between Availability (A) and Consistency (C); Else (E), choose between Latency (L) and Consistency (C). Even in healthy networks, synchronizing state across replicas increases round-trip latency.