CAP Theorem and PACELC, Properly Explained
The most misquoted theorem in the industry. What CAP really says, why the interesting trade-off happens when there is no partition, and how to classify real systems.
Covers: The actual statement of CAP, why 'pick two' is misleading, PACELC, partition behaviour, real database classifications
Almost everyone can say “consistency, availability, partition tolerance - pick two”. Almost nobody can say what that actually means, and the shorthand is wrong in a way that matters: you do not get to pick P. Networks partition. The real statement is a conditional about what you do when they do.
30-second answer
CAP says that during a network partition, a distributed system must choose between consistency - every read returns the most recent write or an error - and availability - every request receives a non-error response, possibly stale. Partition tolerance is not a choice: networks fail, so any real distributed system must tolerate partitions. That makes CAP a conditional statement about behaviour during a partition, not a menu of three items. 'CA' systems do not exist in a distributed setting; a single-node database is CA only because it is not distributed.
| Letter | Formal meaning | Common misreading |
|---|---|---|
| C - Consistency | Linearizability: every read sees the most recent completed write | 'The data is correct' (that is ACID's C) |
| A - Availability | Every request to a non-failing node returns a non-error response | 'The system has high uptime' |
| P - Partition tolerance | The system continues operating despite dropped messages between nodes | 'We handle failures' |
What each choice looks like in practice
| CP - choose consistency | AP - choose availability | |
|---|---|---|
| During a partition | Minority side rejects reads and writes | Both sides accept, and diverge |
| Client sees | Errors or timeouts | Success, possibly stale data |
| After healing | Nothing to reconcile | Conflict resolution required |
| Right for | Balances, inventory, bookings, config | Feeds, likes, shopping carts, presence, metrics |
| Examples | etcd, ZooKeeper, Spanner, HBase, Mongo (default) | Cassandra, DynamoDB (eventual), Riak, Cosmos (tunable) |
PACELC: the part CAP leaves out
CAP only describes behaviour during a partition - a rare event. PACELC extends it to the common case: if there is a Partition, choose Availability or Consistency; Else, choose Latency or Consistency.
The 'else' clause is where you actually live 99.99% of the time. Even with a perfectly healthy network, synchronous replication to a quorum across zones adds a round trip to every write. You are trading latency for consistency continuously, not just during failures - and that trade shapes your p99 far more than partitions ever will.
| System | PACELC classification | Reading |
|---|---|---|
| Cassandra (defaults) | PA/EL | Available under partition; low latency otherwise |
| DynamoDB (eventual) | PA/EL | Same posture, tunable per request |
| MongoDB (default) | PC/EC | Consistent under partition and in normal operation |
| Google Spanner | PC/EC | Consistent always - paid for with TrueTime and commit-wait latency |
| Riak | PA/EL | Available and fast; conflicts resolved with CRDTs or vector clocks |
| Postgres (single primary) | PC/EC | Not partition tolerant across the primary; consistent |
Say these points
- P is not optional; CAP is a conditional about behaviour during a partition.
- C means linearizability, not 'the data is valid' - that is ACID's C.
- PACELC adds the everyday trade: latency versus consistency with no partition present.
- Most databases are tunable per request rather than fixed at CP or AP.
- Different features in one product can and should make different choices.
Avoid these mistakes
- Saying 'pick two' as though CA were achievable in a distributed system.
- Conflating CAP's C with ACID's C.
- Labelling a database CP or AP without mentioning tunability.
- Ignoring the far more common latency-versus-consistency trade.
Expect these follow-ups
- Your shopping cart is AP. Two devices add different items during a partition. What do you do on heal?
- How does Spanner claim to be consistent and highly available at once?
- Which parts of a ride-hailing app are AP and which are CP?
Showing 1 of 1 questions for cap-theorem-and-pacelc.
Check your understanding
3 questions · no sign-up, nothing stored