CAP and PACELC
During a partition you choose consistency or availability; otherwise you trade latency against consistency.
“The “2 of 3” formulation was always misleading because it tended to oversimplify the tensions among properties.”
To an executive
When systems are split by a fault, you must choose between showing possibly stale information and refusing service. Even in normal running, faster responses cost some accuracy.
To an engineer
Decide per operation what to give up during a partition, consistency or availability, and in normal running, latency or consistency. Don't treat it as a single system-wide setting.
The idea
Eric Brewer's CAP theorem says that when a network partition occurs, a distributed system must choose between consistency (every read sees the latest write) and availability (every request gets a response). Partitions are not optional in a distributed system, so the real choice is what to give up when one happens.
Daniel Abadi's PACELC extends this: if there is a Partition, choose Availability or Consistency; Else, in normal operation, choose Latency or Consistency. Keeping replicas in step costs round trips on every request, even when nothing is wrong. Abadi argued that this everyday trade-off has arguably shaped database design more than partitions have.
Brewer himself, twelve years on, warned that "pick two of three" is misleading. Partitions are rare, the choice can be made per operation, and both consistency and availability come in degrees.
Why it works
It forces an explicit failure decision. Asking "what should this do during a partition?" turns a hidden default into a design choice.
It names the everyday cost. PACELC reminds you that strong consistency is paid for in latency all the time, not only during failures.
It works at the level of operations. Different data and operations can make different choices within one system.
Where it applies
- Data store selection, where products make different default choices and some can be tuned.
- Multi-region designs, where cross-region round trips make the latency cost obvious.
- Domain design, where business rules decide which data must be strongly consistent.
How to apply
- List the critical operations. For each, ask what should happen during a partition: fail, or serve possibly stale data.
- Ask the else question. For each, decide whether lower latency or stronger consistency matters more in normal operation.
- Choose per use case, not per system. Account balances and stock reservations may need strong consistency; reviews and recommendations rarely do.
- Match the store and settings. Pick data stores, replication modes and read settings that implement those choices, and write the decisions down.
Example scenario
A retailer ran a single strongly consistent database across regions, so every write, including adding an item to a wish list, paid a cross-region round trip. Pages were slow for customers far from the primary region, and an inter-region network problem took writes down everywhere.
The architects classified operations. Inventory reservations and payments kept strong consistency. Catalogue browsing, wish lists and reviews moved to regional replicas with eventual consistency. Page latency for distant customers fell sharply, and a later network partition degraded checkout in one region rather than the whole site.
Questions to ask
- During a partition, should this operation fail or serve possibly stale data?
- What latency are we paying for consistency on every request, even when nothing is wrong?
- Which data truly needs strong consistency, and which can tolerate a short delay?
When not to use it
- Single-node systems, where there is no partition to reason about.
- As the only lens on data store choice; durability, operability, cost and query model often matter more.
How it misleads you
Treating CAP as a pick-two menu, or labelling a whole product "CP" or "AP". You cannot opt out of partitions, many systems are tunable, and most real systems mix choices per operation. The labels hide the questions that matter: what happens to this operation, for this data, when things go wrong?
In the wild
- GitHub's 43-second partition, October 2018A 43-second loss of connectivity led GitHub's failover tooling to promote West Coast databases; both sites then held writes the other lacked, and GitHub chose a day of degraded service over failing back and risking the consistency of users' data.GitHub · 2018 (opens in a new tab)
- Spanner, TrueTime and the CAP theorem, 2017Google's paper explains how Spanner offers strong consistency with very high availability across regions, a pairing usually thought ruled out by CAP, and why this remains consistent with the theorem, with TrueTime clocks supporting consistent reads and snapshots.Google Research · 2017 (opens in a new tab)
Further reading
- CAP Twelve Years Later: How the "Rules" Have ChangedEric Brewer · Article · 2012(opens in a new tab)
- Consistency Tradeoffs in Modern Distributed Database System Design: CAP is Only Part of the StoryDaniel J. Abadi · Paper · 2012(opens in a new tab)
Last reviewed · Suggest an improvement