Consistency, availability, partition tolerance — you can only choose two, and why it matters.
Published September 21, 2026
The CAP theorem is one of the most quoted, and most misquoted, ideas in distributed systems. Its popular slogan, "pick two of three", is misleading. What it actually says is narrower and more useful:
In a distributed data store, when a network partition occurs, you must choose between consistency and availability.
Understanding why, and what it means for real databases, lets you justify storage choices properly in design discussions.
CAP's "C" is not ACID's "C". ACID consistency means transactions preserve integrity rules, such as constraints and invariants. Mixing up the two is a common interview mistake.
Networks do partition: switches fail, cables get cut, cloud zones lose connectivity, and long GC pauses make nodes look unreachable. A distributed system can't opt out of partitions. So P isn't a choice. The real question is what the system does when a partition happens:
partition
Node A ─────╳───── Node B
(client writes x=2) (still has x=1; a client reads from B)
Node B has two options:
x = 1. It stays available, but the answer is stale, and it's not linearizable.There's no third option. B can't know about a write it can't hear about. That's the whole theorem. And when there's no partition, a system can be both consistent and available. "CA" only describes a system that isn't distributed, or that simply fails entirely during a partition.
CP-leaning behaviour: during a partition, the side without a majority stops accepting writes, and sometimes reads.
AP-leaning behaviour: every reachable node keeps serving. Replicas may diverge and are reconciled later (eventual consistency).
Many systems are tunable per operation. Cassandra's consistency levels (ONE, QUORUM, ALL), DynamoDB's optional strongly consistent reads, and MongoDB's read and write concerns let you choose CP-like or AP-like behaviour per query. So "Cassandra is AP" really means "Cassandra is usually configured for availability".
Partitions are rare. Replication's costs are constant. PACELC extends CAP to cover normal operation:
If there's a Partition: choose Availability or Consistency. Else (normal operation): choose lower Latency or stronger Consistency.
Keeping replicas strongly consistent means waiting for coordination (a quorum or consensus round trip, possibly across regions) on every write, and sometimes on reads. That's a latency cost paid all the time, not just during failures.
| System (typical configuration) | Partition → | Else → |
|---|---|---|
| Cassandra, DynamoDB (default) | A | L |
| MongoDB (majority concerns) | C | C |
| Spanner, CockroachDB | C | C (with clever clock or consensus engineering to limit latency) |
| PostgreSQL with async replicas | Depends on failover policy | L for replica reads (they may be stale) |
Don't label the whole system CP or AP. Decide per data type and operation:
It also helps to name the consistency model you need between the extremes: read-your-writes for a user's own profile, causal consistency for comment threads. See Replication & Consistency.
Q: Can a distributed system be CA? A: Not in a meaningful sense. Partitions can't be prevented, so a system that claims CA simply hasn't defined its partition behaviour, which in practice means it becomes unavailable or inconsistent when one occurs. A single-node database is "CA" only because it isn't distributed.
Q: Is CAP consistency the same as ACID consistency? A: No. CAP consistency is linearizability: all nodes act like one up-to-date copy. ACID consistency means a transaction moves the database from one valid state to another, preserving constraints and invariants.
Q: Is MongoDB CP or AP? A: It depends on configuration. With a single primary and majority write and read concerns, it behaves as CP: a primary without a majority steps down, and writes fail until a new primary is elected. Reading from secondaries with weaker concerns trades consistency for availability and latency.
Q: Why does PACELC matter more day to day than CAP? A: Because partitions are rare, but the latency cost of strong consistency is paid on every request in normal operation. Choosing between low latency and strong consistency is the decision you actually live with.
Q: How would you apply CAP to an e-commerce system? A: Inventory reservation, payments and order creation need strong consistency, so accept brief unavailability during partitions. Catalogue browsing, recommendations, reviews and carts favour availability, since stale data is acceptable and reconcilable. Different components use different stores or settings.