CAP Theorem & PACELC
Intermediate · 14 min read · High-Level Design, Distributed Systems Theory
What CAP really says, what it does not, and the latency trade-off PACELC adds.
The CAP theorem is probably the most cited — and most misunderstood — idea in distributed systems. Interviewers use it to check whether you understand what really happens when a network fails between replicas, and whether you can map that to concrete product decisions.
The three properties
CAP considers a system that stores data replicated across multiple nodes.
What the theorem actually says
The popular phrasing "pick 2 of 3" is misleading. In any real distributed system, partitions will happen — switches fail, cables are cut, GC pauses and overloaded nodes look like partitions. You cannot opt out of P. So the real choice is only made during a partition:
CP vs AP systems
Common misconceptions
PACELC: the trade-off that exists all the time
CAP only describes behaviour during a partition — which is rare. Daniel Abadi's PACELC extends it to normal operation:
Applying it in a design
For each important piece of data, ask: what's the business cost of a stale or conflicting value, versus the cost of an error or delay?
Interview questions
- Explain the CAP theorem in your own words.
- Why isn't 'CA' a valid choice for a distributed database?
- Is Cassandra CP or AP?
- What does PACELC add to CAP and why does it matter in practice?
Practice
Write your answer before opening the suggested one. Anything you mark "Partly" or "Missed it" comes back in your review deck.
Further reading
Key takeaways
- CAP: during a network partition, a replicated system must choose between consistency (linearizability) and availability.
- Partitions are unavoidable, so "CA" isn't a real option for distributed systems.
- PACELC: even without partitions, you trade latency for consistency.
- Most databases are tunable; the choice is often per operation, not per system.
- Decide per feature based on the business cost of stale data versus errors — money and locks lean CP; feeds, counters and carts lean AP.
Previous: Object Storage & File Uploads · Next: Consistency Models