CAP & PACELC
CAP describes the conflict between consistent responses and availability during a network partition. The partition is the situation in which separate nodes do not communicate.
- PartitionRegions are not reaching.
- ConsistencyCommon view before adoption.
- AvailabilityAcceptance despite separation.
Context
Why this is important
When regions are separated, a system cannot simultaneously keep every response consistent and every request available. Without conscious choice, chance decides what customers experience in the shopping cart. Consistency models deepen your own building blocks.
This building block arranges promises for network partitions. Quorum considers concrete read and write confirmations; consensus arranges binding states.
At a glance · Partition forces a choice
Cart change in network partition
The shopping cart is replicated in two regions. While the regions are separate, the shop decides whether changes to the shopping cart positions are accepted locally or deferred until a common view.
This is how you read the picture
- Partition For “separate” region B is on “without opposite”.
- Consistency If there is consistency, the cart change waits and blocks temporarily.
- Availability If available, the change is stored locally, the merger follows later.
- runningRegion AAccepts change
- runningRegion Bhas the same status
- runningCart changeImmediately accepted
- runningMergingnot necessary
immediatelyAdoption of the amendment
Benefits & limitations
Helps if:
- Distributed access across replicas needs a clear account of which responses remain available during a network partition.
- During normal operation, PACELC adds the trade-off between latency and consistency.
- Different operations receive different guarantees, each defined for the specific access.
Boundaries
- CAP applies during a partition; without a partition, this particular trade-off does not arise and both guarantees are possible.
- Make the choice per operation rather than for the whole system: cart updates and order completion may have different priorities.
- Choosing availability requires a conflict-resolution rule after the partition; Replication and Consistency define how states are reconciled.
In practice
- Relate the claim to a specific operation, partition and consistency guarantee. Then determine which requests are answered or deferred during the partition.
- Distinguish a partition from normal operation and document the chosen trade-off for each. PACELC adds the latency–consistency question when there is no partition.
- Test the actual replica group and configuration under a network partition. Consistency models defines what reads can observe; Quorum explains acknowledgement thresholds.
Read the detailed explanation
During a network partition, a distributed service must trade off linearisable responses against response availability at reachable nodes for each request. PACELC adds the trade-off between latency and consistency during normal operation.
These terms must refer to a specific consistency model and an individual operation. CAP is not a general choice of two system properties; configuration, replica groups and failure domains determine the actual guarantee.
Consistency models define the visibility of an operation; Quorum describes response thresholds available in a replica configuration. CAP concerns the trade-off during a partition.
The CAP theorem originated with Eric Brewer.
Check your understanding
Test yourself in three stages
ReadingCheck in the picture
What happens to separate regions if availability takes priority?
View the solution with justification
The region accepts the change locally. Conflicts are later merged via the conflict rule.
ApplyingTransferred to a new situation
Customers should be able to add cups in the shopping cart even during a separation. What priority does the shop choose, and what follows?
View the solution with justification
It prioritizes availability. The region accepts the change locally and settles conflicts after the separation via the defined conflict rule.
EvaluateWeighing an alternative
The shop prioritizes consistency for cart changes. What is the advantage and disadvantage of this?
View the solution with justification
Advantage: After the joint examination, there is a clear status without subsequent comparison. Disadvantage: Changes can temporarily block during separation, the shopping cart is then less usable.
Explore further
These building blocks continue the thoughts of this page.
References
- Gilbert and Lynch – Brewer’s Conjecture (opens in new tab)Formal proof of the conflict between consistency and availability in partitions.
- Daniel Abadi – Consistency Tradeoffs (opens in new tab)Original work on PACELC and the additional conflict between latency and consistency.
- Eric Brewer – CAP Twelve Years Later (opens in new tab)The author specifies CAP and the handling of partitions and restoration.