Quick revision
The short answer
The CAP theorem says that when a network partition separates the nodes of a distributed system, the system must choose between consistency, meaning linearizability, where every read sees the latest write, and availability, meaning every request to a node that has not failed gets a response. The common misunderstanding is 'pick two of three': partitions are not optional, so the real choice is C or A while a partition lasts. PACELC adds that else, when there is no partition, we still choose between latency and consistency, which is the trade-off we live with most of the time, and many databases let us choose per operation.
What to remember
In this answer, we saw that CAP states a narrow fact: during a network partition, a distributed system must choose between linearizable consistency and availability, where every non-failed node answers. 'Pick two of three' is a myth because partitions cannot be opted out of, and PACELC adds the everyday trade-off between latency and consistency when there is no partition. Since databases such as Cassandra, DynamoDB and MongoDB let us choose per operation, product labels like CP or AP are simplifications, and designs should state the guarantee each operation needs.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
The CAP theorem says that when a network partition separates the nodes of a distributed system, the system must choose between consistency, meaning linearizability, where every read sees the latest write, and availability, meaning every request to a node that has not failed gets a response. The common misunderstanding is 'pick two of three': partitions are not optional, so the real choice is C or A while a partition lasts. PACELC adds that else, when there is no partition, we still choose between latency and consistency, which is the trade-off we live with most of the time, and many databases let us choose per operation.
Why this question is asked
CAP is quoted in almost every discussion of distributed databases, and it is quoted wrongly almost as often. Products are labelled 'CP' or 'AP' as if that settled everything, and people say a system can 'drop partition tolerance'. Interviewers ask this question to see whether we know what the theorem actually states, what its terms mean precisely, and what it leaves out. In this answer, we will define the three terms carefully, walk through a partition step by step, correct the 'two of three' myth, see what PACELC adds for normal operation, and look at why labels on real databases are only simplifications.
1A Quick Recap of the Three Terms
In CAP, consistency has a specific meaning that differs from the C in ACID. It means linearizability: the system behaves as if there were a single copy of the data, and once a write has completed, every later read, from any client, returns that value or a newer one. Availability also has a strict meaning: every request received by a node that has not failed must eventually get a non-error response. A system that answers 'try again later' during a problem is not available in this sense.
A network partition is a failure where messages between some nodes are lost or delayed indefinitely, so the nodes split into groups that cannot talk to each other, even though each group keeps running. Partitions happen in real networks: a switch fails, a cable is cut, a cloud region loses its link, or a long garbage collection pause makes a node look unreachable.
2Walking Through a Partition
Imagine a value x stored on two replicas, N1 and N2, both holding x = 1. The link between them breaks. A client writes x = 2 to N1, and another client then reads x from N2. N2 has two choices. It can answer with x = 1, which keeps it available but breaks linearizability, because a completed write is not visible. Or it can refuse or wait until it hears from N1, which keeps consistency but means N2 is not available. There is no third option, because N2 has no way to learn about the write while the link is down. That is the whole theorem.
6 messages in order. Play them, or step through them one at a time.
During the partition N2 must either answer stale or not answer.
3Correcting the 'Pick Two of Three' Myth
The popular version says we can pick any two of consistency, availability and partition tolerance, so a 'CA' system gives up partition tolerance. But partition tolerance is not a feature we can decline. In any system that runs on more than one machine over a network, partitions will happen, and the system will behave somehow when they do. A design that 'ignores' partitions simply has undefined, usually bad, behaviour during one, such as two nodes both thinking they are the primary.
So the honest statement is narrower: when a partition happens, choose between consistency and availability. When there is no partition, CAP says nothing at all, and both consistency and availability are perfectly possible. A single-node database is the only true 'CA' system, because it has no network between replicas, and it gives up availability entirely when that one node fails.
4What PACELC Adds
Partitions are rare. Most of the time the network works, and CAP is silent about that time. PACELC, proposed by Daniel Abadi, fills the gap: if there is a Partition, choose between Availability and Consistency; Else, choose between Latency and Consistency. The else part matters because keeping replicas consistent requires coordination. A write that must be confirmed by replicas in two regions 80 milliseconds apart takes at least one round trip across that distance, on every write, even when nothing is broken. A system that answers from the nearest replica without waiting is faster but may return stale data.
So PACELC describes the trade-off we pay for every day in latency, not only during failures. Many outages of user experience are not partitions at all but slow coordination.
| System style | During partition | Normal operation | Example |
|---|---|---|---|
| Consensus, synchronous replication | Consistency (PC) | Consistency, higher latency (EC) | Spanner, etcd |
| Dynamo-style, tunable quorums | Availability (PA) | Low latency (EL) | Cassandra, DynamoDB default |
| Primary with async replicas | Depends on failover | Low latency reads, stale replicas | PostgreSQL, MySQL |
5Why Labels Like 'CP Database' Are Simplifications
Real databases let us choose per operation, so a single label rarely fits. Cassandra's consistency level is set on each query: QUORUM reads and writes overlap and favour consistency, while ONE favours latency and availability; its lightweight transactions use a consensus protocol and refuse to proceed without a majority. DynamoDB offers eventually consistent reads by default and strongly consistent reads as an option. MongoDB's write concern and read concern decide whether a write waits for a majority and whether a read sees only majority-committed data.
Notice that the same database runs both statements. That is why, in a design, we should state the guarantee each operation needs rather than the label of the product. Also, many systems give guarantees weaker than linearizability but stronger than 'eventual', such as read-your-writes or causal consistency, which CAP's binary view does not describe.
6Follow-up questions
Is a system that becomes read-only during a partition available?
Not in CAP's strict sense, because write requests to non-failed nodes get errors. In practice it is often a sensible middle ground: the minority side of the partition keeps serving possibly stale reads and refuses writes. CAP's definitions are strict, which is why real systems describe their behaviour more precisely than one letter.
How is CAP consistency different from ACID consistency?
ACID consistency means a transaction moves the database from one valid state to another, respecting constraints such as foreign keys. CAP consistency is linearizability, a guarantee about the order and visibility of operations across replicas. A database can have one without the other.
Does choosing availability mean data is lost?
Not necessarily. It means both sides of a partition may accept writes, which can conflict. When the partition heals, the system reconciles them, for example with last-write-wins, vector clocks or application merge logic, and the quality of that reconciliation decides whether anything is lost.
7Conclusion
In this answer, we saw that CAP states a narrow fact: during a network partition, a distributed system must choose between linearizable consistency and availability, where every non-failed node answers. 'Pick two of three' is a myth because partitions cannot be opted out of, and PACELC adds the everyday trade-off between latency and consistency when there is no partition. Since databases such as Cassandra, DynamoDB and MongoDB let us choose per operation, product labels like CP or AP are simplifications, and designs should state the guarantee each operation needs.
Open with
CAP says that when a network partition happens, so some nodes cannot reach others, a distributed system has to choose between consistency and availability. Consistency here means linearizability: once a write completes, every later read anywhere sees it.
Then, if they want more
Availability means every request to a node that has not failed gets a non-error response. If a replica cut off from the others receives a read, it can either answer with possibly stale data, which is availability, or refuse or wait, which is consistency; it cannot do both.
The common misunderstanding is 'pick two of three', as if you could choose CA and give up partition tolerance. Partitions are not optional in a networked system, so the real choice is only C or A during a partition, and when there is no partition you can have both.
PACELC adds the part that matters day to day: else, without a partition, you choose between latency and consistency, because keeping replicas in sync costs coordination round trips, especially across regions. Systems with synchronous replication or consensus, like Spanner, favour consistency; Dynamo-style stores like Cassandra favour availability and low latency by default.
But most databases let you choose per operation, such as Cassandra consistency levels, so labels like CP database are simplifications.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Redis documentation, MongoDB manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Explain the CAP theorem correctly, including the common misunderstanding, and what...": https://scrivio-interview-library.netlify.app/databases/nosql-fundamentals/4121b02615/