Consistency Guarantees
Part of distributed systems.
Question: what can a replicated system promise about the values clients read and write, and what does each promise cost?
Every copy of data, whether a replica, a cache, or an index, can disagree with the others for a while. A guarantee names which disagreements a client may observe. Stronger guarantees hide more of them and cost more waiting on the network. The requirement side, deciding what each operation of a design needs, is in consistency.
Consistency models
State the requirement for each operation as one of these models, from strongest to weakest. Burckhardt (2014) builds the same hierarchy formally.
The latency column follows Kleppmann’s (2015) summary of known lower bounds. For sequential consistency, a single register is an exception: Burckhardt shows one that is sequentially consistent with every operation answering at once, so the cost appears only with richer data types.
Three cautions on terms:
- “Strong consistency” is not a defined model. It can mean linearizability, sequential consistency, or one-copy serializability, so name the model instead.
- Consistency models and isolation levels are different restrictions. Consistency models constrain single-object operations across replicas; isolation levels such as serializability and snapshot isolation constrain multi-object transactions, usually on one copy.
- The C in ACID is a third, unrelated meaning: the application’s invariants hold after each transaction.
The weaker per-client guarantees in session guarantees are often enough and cost far less than linearizability.
Session guarantees
Terry et al. (1994) defined four guarantees for a single client’s session. They are cheap because they constrain what one client sees, not what all clients agree on.
DDIA adds consistent prefix reads: readers see writes in an order that respects causality, so an answer never appears before its question. Partitioned stores break it when related writes land on different partitions; writing causally related data to the same partition, or tracking dependencies, restores it.
Causal consistency provides all four session guarantees across every client, not only within one session.
Isolation levels
Isolation levels restrict what concurrent transactions may observe of each other’s multi-object reads and writes. They are a different axis from the consistency models above, which describe single objects across replicas.
Level names are not portable. “Repeatable read” means snapshot isolation in some databases and something weaker in others, so check what a given database actually provides. Write skew is the anomaly to watch for: two transactions each read the same data, decide based on it, and write different objects, as when two doctors both leave an on-call rota that requires at least one of them. Mechanics and examples are in transactions.
CAP and PACELC
What CAP proves
Fox and Brewer stated the CAP principle in 1999, and Gilbert and Lynch proved a version of it in 2002. In an asynchronous network that can lose messages, no read-write register can guarantee both linearizability and that every request to a non-failing node eventually gets a response.
What the terms mean (Kleppmann 2015):
- C is linearizability, one model from the table above. Fox and Brewer used one-copy serializability. It is not the C in ACID, and CAP says nothing about the weaker models.
- A means every non-failing node eventually answers, with no bound on latency. That is a property of an algorithm, not the uptime percentage engineers measure. A leader-based database with 99.99 percent uptime is “unavailable” in this sense, because a client cut off from the leader cannot write even when it can reach another replica.
- P is an assumption, not a feature. It says partitions can occur. Networks do partition, so a distributed system has to assume it, and “pick two” with a “CA” option is misleading.
- The proof needs partitions that never heal. If every partition eventually ends, a linearizable algorithm can wait it out and still satisfy A, which sets no deadline. Under a partition that never heals, eventual consistency is impossible too, because no information crosses it.
Its scope is narrower than its reputation:
- It covers one model and, in Gilbert and Lynch’s form, one data type. Burckhardt (2014) proves a version for sequential consistency that holds for all but the simplest data types.
- It covers only the time a partition exists. With no partition, it allows full consistency and availability together (Abadi 2012).
- Kleppmann concludes that CAP has done its job, prompting the exploration of weaker models, and should no longer be used to justify design decisions.
What remains useful: during a partition, an operation that needs linearizability must wait or fail on the side that cannot reach the others. Make that choice per operation:
- A ticket booking rejects the write when the primary is unreachable, because a double booking is worse than an error.
- A news feed serves stale data from any replica, because an old feed is better than none.
PACELC
Abadi (2012) starts from an observation: Dynamo, Cassandra, Riak, and PNUTS weaken consistency all the time, not only during partitions, which are rare. The reason is latency, not CAP. High availability requires replication, and once data is replicated, every update trades consistency against latency, with or without a partition.
The formulation: if there is a Partition (P), how does the system trade Availability against Consistency (A and C)? Else (E), in normal operation, how does it trade Latency against Consistency (L and C)?
Where the latency comes from. An update can go first to one of three places, and each forces the trade-off:
Within one datacenter, synchronous replication to a master can be cheap. Across a WAN, there is no way around the trade-off. Even R + W > N does not give linearizability without further protocol steps.
Abadi’s classification of the 2012 default configurations:
PNUTS is Abadi’s main evidence: it chooses consistency during partitions, so CAP did not make it weaken consistency; latency did. Several of these systems have since added settings that move them between classes, so treat the table as an illustration of the trade-off, not a current product guide.
Delay sensitivity
Kleppmann (2015) proposes replacing CAP with a question every operation can answer: does its latency depend on network delay?
- Treat network faults as delay. When lost messages are retried, packet loss, and even a partition that eventually heals, look like very large delay.
- Define availability empirically: the share of requests that return a successful response within the SLA’s latency bound, such as 500 ms.
- Classify each operation as delay-sensitive, with latency proportional to network delay, or delay-independent. The models table gives the lower bound for each consistency model.
- Name the delay that matters. A leader-based write depends on the delay between client and leader, which may include a WAN link and grows to the length of a partition between them. A majority quorum depends only on the fastest majority, so a partitioned minority does not slow it. COPS places a leader in each datacenter: operations are linearizable within a datacenter and causal across datacenters, so they depend only on local delay.
- Match it to the SLA. If the latency bound is much shorter than the network interruptions to expect, the operation must be delay-independent. Taken to the end, that is offline operation: a calendar app on a phone keeps working in a tunnel and syncs later.
- State fault tolerance explicitly instead of “highly available” or “partition tolerant”: the largest fault tolerated, such as a minority of replicas crashing or disconnecting, and what happens beyond it, such as errors or a violated guarantee.
Choosing consistency per operation
Many databases let an application request stronger consistency for some operations only. Requesting it too often costs latency and availability; requesting it too rarely breaks correctness. Gotsman et al. (2016) separate two kinds of problem:
- Ordering anomalies, such as seeing a comment without the post it answers, are prevented by causal consistency, which needs no synchronization.
- Integrity invariants, such as “a balance never goes negative”, can still break under causal consistency. Two replicas each accept a withdrawal of 100 from a balance of 100, and once they exchange updates the balance is −100.
Their rule: declare which pairs of operations conflict, meaning neither may run without seeing the other, and synchronize only those pairs. For the account, withdrawals conflict with each other; deposits conflict with nothing and stay causal. Their proof rule then checks each operation on its own against the invariant, assuming the others behave as the conflict relation allows, and their tool automates the check with an SMT solver.
In a design: list the invariants, then for each pair of operations ask whether running both concurrently, without either seeing the other, can break one. Two bookings of the same seat conflict; browsing conflicts with nothing.
In a design
The checklist for recording each operation’s requirement (model, behavior when replicas are unreachable, delay sensitivity, invariants) is in consistency. The consensus behind operations that must synchronize is in broadcast and consensus, and the alternatives that avoid it are in coordination avoidance.
Related notes
- System models: the fault and timing assumptions every guarantee depends on.
- Time and order: the clocks and orderings that causal and linearizable systems are built from.
- Replication: replication logs, lag, and the read anomalies these guarantees rule out.
- Transactions: the mechanisms behind the isolation levels.
- Data at scale: where replicas, caches, and indexes create the copies that disagree.
Gaps
- The other papers in the 2012 IEEE Computer issue on CAP: Brewer’s CAP Twelve Years Later and Gilbert and Lynch’s Perspectives on the CAP Theorem.
- Work Kleppmann cites on avoiding coordination: highly available transactions, coordination-avoiding databases, and probabilistically bounded staleness (Bailis et al.).
- The variants of causal consistency (causal+, real-time causal, observable causal) that Kleppmann mentions without comparing.
Sources
- Abadi, Consistency Tradeoffs in Modern Distributed Database System Design: CAP Is Only Part of the Story, IEEE Computer 45(2), 2012 (doi:10.1109/MC.2012.33).
- Kleppmann, A Critique of the CAP Theorem, 2015 (arXiv:1509.05393).
- Gotsman, Yang, Ferreira, Najafzadeh, and Shapiro, ‘Cause I’m Strong Enough: Reasoning about Consistency Choices in Distributed Systems, POPL 2016 (doi:10.1145/2837614.2837625).
- Burckhardt, Principles of Eventual Consistency, Foundations and Trends in Programming Languages 1(1-2), 2014 (doi:10.1561/2500000011).
- Gilbert and Lynch, Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services, ACM SIGACT News, 2002 (doi:10.1145/564585.564601) – the CAP proof.
- Fox and Brewer, Harvest, Yield, and Scalable Tolerant Systems, HotOS 1999 (doi:10.1109/HOTOS.1999.798396) – the original CAP principle.
- Terry et al., Session Guarantees for Weakly Consistent Replicated Data, PDIS 1994 (doi:10.1109/PDIS.1994.331722).
- Herlihy and Wing, Linearizability: A Correctness Condition for Concurrent Objects, TOPLAS, 1990 (doi:10.1145/78969.78972).
- Berenson et al., A Critique of ANSI SQL Isolation Levels, SIGMOD 1995 (doi:10.1145/568271.223785).
Library sources
- Abadi 2012, Consistency Tradeoffs in Modern Distributed Database System Design (doi:10.1109/MC.2012.33) – on PACELC
- Kleppmann 2015, A Critique of the CAP Theorem (arXiv:1509.05393) – on What CAP proves, Delay sensitivity, and the latency column of Consistency models
- Gotsman et al. 2016, ‘Cause I’m Strong Enough (doi:10.1145/2837614.2837625) – on Choosing consistency per operation
- Burckhardt 2014, Principles of Eventual Consistency, excerpt (doi:10.1561/2500000011) – the hierarchy of models and CAP for sequential consistency
- Kleppmann and Riccomini 2026, Designing Data-Intensive Applications, Second Edition – chapter 6 on Session guarantees; chapter 8 on Isolation levels; chapter 10 on linearizability, its cost, and CAP
- Vitillo 2021, Understanding Distributed Systems, Second Edition – chapter 10 on consistency models; chapter 12 on transactions
Further reading:
- Tornow 2025, Think Distributed Systems – chapter 9, consistency
- Davoudian et al. 2018, A Survey on NoSQL Stores (doi:10.1145/3158661) – consistency models and CAP as design principles of NoSQL stores
- Herlihy et al. 2021, The Art of Multiprocessor Programming, Second Edition – chapter 3, linearizability versus sequential consistency for shared-memory objects (3.4), the origin of the strongest models in Consistency models