Yashotantra Academy logo

2 · Distributed Core & Consensus

2. The CAP & PACELC Theorems

Consistency, Availability, Partition Tolerance, and the latency trade-offs of healthy networks.

10 min read · 3 MCQs

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.

Chapter quiz

3 questions · pass mark 75%
  1. 1. In a distributed system, why is Partition Tolerance (P) non-negotiable?

  2. 2. What does the PACELC theorem add to the traditional CAP theorem?

  3. 3. A bank account transaction ledger during a network split should prioritize: