A distributed data store promises three things at once: every node answers any request (availability), all clients see the same data (consistency), and the system keeps working even when the network is partitioned (partition tolerance). The CAP theorem states that no system delivers all three promises at once: when a partition happens, a data store sacrifices consistency or availability.
What C, A and P mean
| Property | What it promises | What happens during a network partition |
|---|---|---|
| C — consistency | every read returns the latest written record or an error | the node replies with an error if it is not sure its data is up to date |
| A — availability | every request receives a response, even if not the freshest one | the node keeps answering from its own local data |
| P — partition tolerance | the system keeps working even when the link between nodes is broken | the network between nodes no longer delivers messages |
How the choice is made
When the network is partitioned, a system either rejects writes and reads of stale data or keeps answering with out-of-date copies. CP systems preserve consistency and lose availability: etcd by default routes every read through cluster consensus and does not respond without a quorum of nodes. AP systems stay available and diverge: at a low consistency level, Cassandra serves data from the nearest replica, and the copies converge once the network recovers.
- CP — etcd, ZooKeeper, PostgreSQL with synchronous replication: a write succeeds only if a quorum of nodes or a synchronous standby acknowledges it;
- AP — DNS, web caches, Cassandra at a low consistency level: a node answers from its local data, and diverging copies converge later.
Where the theorem comes from
In 2000, Eric Brewer set out this line of reasoning as a conjecture in an invited talk at the PODC conference, and in 2002 Seth Gilbert and Nancy Lynch proved it for an asynchronous network model with atomic (linearizable) data. Brewer emphasised that the choice is not a switch but a spectrum: practical systems remain a mix of strict (ACID) and available but weakly consistent (BASE) subsystems.
Sources
the term is written from these pages- Eric A. Brewer — Towards Robust Distributed Systems (PODC 2000 keynote)people.eecs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf(opens in a new tab)
- Gilbert, Lynch — Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services (2002)comp.nus.edu.sg/~gilbert/pubs/BrewersConjecture-SigAct.pdf(opens in a new tab)
Verified 18 Nov