Consistency Models Explained: Linearizability vs Serializability vs Sequential, Causal and Eventual Consistency (2026)
A database can be fully serializable and still show you a balance that is ten seconds old. A key-value store can be linearizable and still let two transactions jointly drain a bank account. These are not bugs in the products. They are the predictable result of consistency models that answer two different questions, and most outages blamed on “eventual consistency” are really a mismatch between the question the team asked and the guarantee the system gives. In 2026 almost every stack mixes a strongly consistent control plane such as etcd, a distributed SQL tier, a cache, and an edge replica that must keep working offline. Each layer documents its guarantee in its own vocabulary, and the vocabulary is where mistakes start. This explainer gives you a single map, concrete anomalies you can reproduce, a working linearizability-checker sketch in Python, and a decision procedure for picking the weakest model that keeps your invariants true.
What this covers: the two axes of consistency (recency versus transaction isolation), linearizability vs serializability, strict serializability, sequential, causal and eventual consistency, the anomalies each one forbids, CAP and PACELC, what Spanner, CockroachDB, DynamoDB, Cassandra, etcd and MongoDB actually promise, a Python checker, failure modes and a decision table.
Context and Background
The vocabulary comes from two research communities that did not talk to each other for about a decade. Concurrency and multiprocessor researchers cared about single objects, such as a memory cell, a register or a queue, shared by many threads. Database researchers cared about transactions, groups of reads and writes over many objects that must appear atomic. Both communities produced their canonical consistency models around 1979 and 1990, and both used the word “consistency” for things that are only partly related.
On the multiprocessor side, Leslie Lamport defined sequential consistency in “How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs” (IEEE Transactions on Computers, 1979). Maurice Herlihy and Jeannette Wing defined linearizability in “Linearizability: A Correctness Condition for Concurrent Objects” (ACM TOPLAS, 1990), adding a real-time constraint that sequential consistency lacks. On the database side, Christos Papadimitriou’s “The Serializability of Concurrent Database Updates” (Journal of the ACM, 1979) formalised serializability. Berenson, Bernstein, Gray, Melton, O’Neil and O’Neil then showed in “A Critique of ANSI SQL Isolation Levels” (SIGMOD 1995) that the SQL standard’s isolation levels were ambiguous and that snapshot isolation sat outside them. Atul Adya’s 1999 MIT thesis restated isolation levels as forbidden cycles in a dependency graph, which is still how testing tools reason today.
The distributed systems era fused the two families of consistency models. Gilbert and Lynch’s 2002 proof of the CAP conjecture (ACM SIGACT News) used linearizability as its definition of “consistent.” Bailis and colleagues’ “Highly Available Transactions: Virtues and Limitations” (PVLDB volume 7, 2013) then sorted both families by which ones can survive a network partition. Kyle Kingsbury’s Jepsen project compiled the result into the Jepsen consistency map, which is the closest thing the field has to a shared reference.
This post is the conceptual layer under several topics we have covered separately. Our explainer on MVCC, snapshot isolation, write skew and SSI goes deep on how one database implements isolation. Here we stay one level up: what the consistency models mean, how they relate, and which one a given workload actually needs.
The Map of Consistency Models: Two Axes, One Peak
Consistency models are sets of allowed histories. Linearizability is a single-object, real-time guarantee: each operation appears to take effect at one instant between its call and its return. Serializability is a multi-object, transaction guarantee: the result equals some serial order, which need not match real time. Strict serializability demands both.

Figure 1: The hierarchy of consistency models, after the Jepsen map. An arrow from A to B means every history allowed by A is also allowed by B.
Figure 1 arranges the consistency models in two branches meeting at the top. The left branch is the transactional, multi-object family: serializable, snapshot isolation, repeatable read, monotonic atomic view and read committed. The right branch is the single-object family: linearizable, sequential, causal, PRAM and the session guarantees such as read-your-writes. Strict serializability sits above both, because it is serializability plus the real-time ordering that makes linearizability strong. Snapshot isolation and repeatable read are incomparable; each allows an anomaly the other forbids.
A consistency model is a set of histories, nothing more
The cleanest definition comes from Jepsen: a consistency model is a safety property that names the set of histories a system may produce. A history is a record of operations, each with an invocation time, a completion time, and the values read or written. Model A is stronger than model B when A’s set is a subset of B’s. That is all “stronger” means.
Treating consistency models as sets removes a lot of confusion. A model says nothing about implementation, replication factor, or whether the data lives in RAM or on disk. It is a contract about observable behaviour at the client boundary. If a client can never observe a history outside the set, the system meets the model, however it is built. Conversely, a single observed history outside the set is a counterexample, which is exactly what testing tools look for.
The framing also explains why vendors’ claims about consistency models are hard to compare. “Strong consistency” is not a point on the map. It can mean linearizable single-key reads, serializable transactions, or something weaker that is merely “stronger than our default.” When a vendor uses that phrase, translate it into a node on Figure 1 before you rely on it.
Recency is the real-time axis
Linearizability says that every operation appears to take effect atomically at some point, called its linearization point, between its invocation and its response. The consequence that matters in practice: if operation A completes before operation B begins, in wall-clock real time, then B must observe A’s effect. No client can ever read a value that was already overwritten before the read started.
Sequential consistency drops that real-time rule. Lamport’s definition requires that the result equal some single total order of all operations, and that each process’s operations appear in that order in program order. Two different clients may disagree with wall-clock time, so a read that starts after a write finished may still return the old value, as long as some legal interleaving explains it. Causal consistency drops even the single total order. It only requires that operations related by cause and effect, such as “I read X and then wrote Y,” appear in that order to everyone, while concurrent writes may be seen in different orders by different replicas.
Herlihy and Wing proved a property that made linearizability the default for concurrent objects: it is local, or compositional. If every individual object in a system is linearizable, the system as a whole is linearizable. Sequential consistency does not compose. Two sequentially consistent registers can, together, produce a history that no single sequential order explains. That is a practical reason to prefer linearizable building blocks such as an etcd key or a Raft-replicated log entry.
Isolation is the transaction axis
Serializability talks about transactions, not single operations. A history is serializable if its outcome is equivalent to running the committed transactions one at a time in some order. Crucially, the order is unconstrained. A serializable database may order your transaction T2 before T1 even though T1 committed, returned to the client, and was announced on a dashboard before T2 even started. Nothing in Papadimitriou’s definition forbids that.
Real single-node databases rarely exploit this freedom, so engineers rarely notice it. Replicated systems do exploit it, most commonly by serving reads from a snapshot that is slightly in the past. The result is serializable but stale. This is the root of the linearizability vs serializability confusion: they constrain different things, and neither implies the other.
The weaker isolation levels, such as snapshot isolation and read committed, are defined by which anomalies they permit. Adya’s formalism draws a graph whose nodes are transactions and whose edges are write-write, write-read and read-write (anti-dependency) relationships. Serializability forbids every cycle. Snapshot isolation allows cycles that contain two adjacent anti-dependency edges, which is exactly write skew. Read committed allows more again.
Strict serializability and Spanner’s “external consistency”
Strict serializability is serializability where the serial order must respect real time: if T1 commits before T2 starts, T1 comes first. It is equivalent to treating the whole database as one giant linearizable object whose operations are transactions. Google’s documentation calls the same property external consistency and states plainly that “linearizability can be viewed as a special case of external consistency,” because external consistency applies to transactions over many objects (Spanner: TrueTime and external consistency).
Strict serializability is the only model on the map under which a developer can reason as if there were a single machine executing one transaction at a time in the order users experienced. Everything below it requires the developer to know which anomalies remain. That is why it is worth knowing which systems actually provide it, a topic we return to later, and what it costs in latency.
Walk-through: Anomalies, Histories and a Linearizability Checker
The fastest way to internalise consistency models is to look at concrete histories and ask which models allow each one. Three anomalies, each forbidden by some consistency models and allowed by others, cover most production incidents: the stale read, the lost update, and write skew.
The stale read: serializable, not linearizable
Consider a single key x, initially 0, replicated by a leader-based protocol. Client A writes x = 1; the leader commits it on a quorum and acknowledges. A then tells client B, through some side channel such as a message queue or a phone call, that the write is done. B reads x from a follower that has not yet applied the entry and gets 0.

Figure 2: A stale read. The history is serializable and even sequentially consistent, but it violates linearizability because B’s read began after A’s write completed.
Figure 2’s history is legal under serializability: order B’s read before A’s write and everything checks out. It is legal under sequential consistency for the same reason. It is illegal under linearizability, because A’s write completed, in real time, before B’s read was invoked, so B must see 1. This is the precise anomaly that etcd’s linearizable reads, MongoDB’s linearizable read concern and DynamoDB’s ConsistentRead=true exist to rule out. It is also the anomaly that follower reads, read replicas and caches routinely introduce.
The side channel is what makes this an incident rather than a curiosity. Without it, nobody can tell that B’s read was “late.” With it, B acts on information that contradicts something the system already told A. Kingsbury and others call this the real-time or “external” communication problem, and it is why recency guarantees matter even in systems where all writes go through one leader.
The lost update: why read-modify-write needs more than read committed
Two transactions read a counter that holds 10, each adds 1 in application code, and each writes back 11. Both commit. The counter should be 12 and is 11. Berenson et al. named this phenomenon P4, lost update. Read committed allows it, because each transaction only reads committed data. Snapshot isolation forbids it, because its “first committer wins” rule aborts the second transaction that tries to write a row someone else changed since its snapshot.
The cheapest fixes are mechanical. Use an atomic in-database update (UPDATE ... SET n = n + 1), take a row lock with SELECT ... FOR UPDATE, or use a conditional write such as a compare-and-set on a version column. CockroachDB’s documentation explicitly lists lost updates and write skew among the anomalies its READ COMMITTED level permits, and recommends locking reads to mitigate them (CockroachDB Read Committed).
Write skew: the anomaly snapshot isolation lets through
The classic write skew example is a hospital rota. The invariant: at least one doctor must be on call. Alice and Bob are both on call and both feel unwell. Each starts a transaction, counts on-call doctors, sees 2, and sets themselves off call. Their write sets are disjoint, Alice’s row and Bob’s row, so snapshot isolation sees no write-write conflict and commits both. Nobody is on call.

Figure 3: Write skew under snapshot isolation. Each transaction’s read is invalidated by the other’s write, forming a cycle of two read-write anti-dependencies.
In Adya’s terms, T1 read a row T2 later wrote, and T2 read a row T1 later wrote, forming a cycle of two anti-dependency edges. Serializability forbids that cycle; snapshot isolation does not detect it. Berenson et al. labelled it A5B. PostgreSQL’s REPEATABLE READ is snapshot isolation and allows it; PostgreSQL’s SERIALIZABLE uses Serializable Snapshot Isolation, which tracks these “dangerous structures” and aborts one transaction. Oracle’s level named SERIALIZABLE is, by long-standing analysis, snapshot isolation and also allows write skew. Names on isolation levels are not definitions, which is the whole point of the 1995 critique.
The practical lesson is that write skew violates an invariant that spans rows, and no amount of single-key linearizability prevents it. A key-value store where every key is linearizable can exhibit write skew across two keys with no effort at all. That is the most important thing to understand about linearizability vs serializability: one is about freshness of a single object, the other is about the integrity of invariants across many.
A worked example: checking a history for linearizability
Testing tools such as Jepsen’s Knossos, the Go library Porcupine, and Jepsen’s Elle for transactional histories all work by recording a real history and searching for a legal order. For linearizability the search is conceptually simple: repeatedly pick an operation that could be the next to take effect, apply it to a sequential model of the object, and backtrack if a read returns the wrong value.
An operation can go next only if no other remaining operation completed before it was invoked. That one rule is the entire real-time constraint. Here is a compact, runnable checker for a single register, in the style of the Wing and Gong search with memoisation on the remaining set and current state.
from dataclasses import dataclass
from functools import lru_cache
@dataclass(frozen=True)
class Op:
client: str
kind: str # "write" or "read"
value: int # value written, or value the read returned
start: float # invocation time
end: float # completion time
def step(state, op):
"""Sequential spec of a register. Returns (ok, new_state)."""
if op.kind == "write":
return True, op.value
return op.value == state, state
def linearizable(history, initial=0):
ops = tuple(history)
@lru_cache(maxsize=None)
def search(remaining, state):
if not remaining:
return ()
pending = [ops[i] for i in remaining]
for i in remaining:
op = ops[i]
# op may go next only if no other pending op finished before it started
if any(o.end < op.start for o in pending if o is not op):
continue
ok, new_state = step(state, op)
if not ok:
continue
rest = search(remaining - frozenset([i]), new_state)
if rest is not None:
return (op,) + rest
return None
order = search(frozenset(range(len(ops))), initial)
return order is not None, order
if __name__ == "__main__":
stale = [
Op("A", "write", 1, 0, 10),
Op("B", "read", 1, 12, 14),
Op("C", "read", 0, 15, 17), # finished-before ordering forbids this
]
overlap = [
Op("A", "write", 1, 0, 10),
Op("B", "read", 0, 2, 4), # overlaps the write, so 0 is allowed
Op("C", "read", 1, 5, 9),
]
for name, h in [("stale read", stale), ("overlapping", overlap)]:
ok, order = linearizable(h)
print(name, "->", "linearizable" if ok else "NOT linearizable",
[f"{o.client}:{o.kind}={o.value}" for o in order] if ok else "")
Running it prints stale read -> NOT linearizable and overlapping -> linearizable ['B:read=0', 'A:write=1', 'C:read=1']. The second case shows the subtle part. B’s read of 0 overlaps A’s write, so the checker may place B’s linearization point before the write takes effect. C’s read also overlaps the write and returns 1, so it goes after. Overlapping operations are genuinely concurrent, and linearizability lets either order win.
Three caveats apply to this sketch. First, it ignores crashed operations; real checkers treat an operation with no response as possibly taking effect at any later time, which multiplies the search space. Second, the general problem is hard. Gibbons and Korach showed in “Testing Shared Memories” (SIAM Journal on Computing, 1997) that checking linearizability of a general history is NP-complete, and Papadimitriou’s 1979 paper showed the same for testing view serializability. Third, this is why practical checkers partition histories by key, exploiting the locality property, and why Elle avoids the general search by designing workloads, such as append-only lists, whose results reveal the dependency graph directly.
What the search tells you about cost
The checker also illustrates why linearizability is expensive to provide, not just to test. To guarantee that a read reflects every write that completed before it started, a replica must know that no newer write exists anywhere. In a leader-based system that means either routing the read through the leader and confirming leadership with a quorum, or holding a time-based lease and trusting bounded clock drift. Either way, a linearizable read costs at least one quorum round trip or depends on a clock assumption. Our deep dive on Raft vs Paxos leader election and consensus failure modes covers the ReadIndex and lease-read techniques in detail.
CAP, PACELC and the Consistency Models Real Systems Actually Promise
Consistency models become operational decisions when you combine them with failure and latency. Two results frame those decisions.
CAP: a theorem about linearizability, not about databases
Gilbert and Lynch formalised Eric Brewer’s conjecture by taking “consistency” to mean linearizable (they used the older term atomic) read-write objects, “availability” to mean every request to a non-failed node eventually gets a response, and “partition tolerance” to mean the system keeps its guarantees when messages are lost. Under those definitions, no system can provide all three during a partition. The theorem is narrow. It says nothing about latency, nothing about transactions, and nothing about what happens when there is no partition.
The HAT paper refined this by checking all the consistency models on the map. Bailis et al. showed that read committed, monotonic atomic view, monotonic reads, monotonic writes and writes-follow-reads can all be provided with total availability. Read-your-writes, PRAM and causal consistency need sticky availability, meaning a client must keep talking to the same logical replica. Snapshot isolation, repeatable read, serializability, cursor stability and every recency model including linearizability cannot be highly available, because preventing lost updates, write skew or stale reads requires coordination during a partition. The same paper’s survey of 18 databases, as of January 2013, found only three defaulting to serializability (Bailis et al., PVLDB vol. 7).
That result is the most useful line on the whole map. Causal consistency is, in a precise sense, the strongest broadly useful single-object guarantee among the consistency models you can keep while partitioned, and Mahajan, Alvisi and Dahlin’s 2011 University of Texas technical report argued that a real-time variant of causal consistency is the strongest such model under their definitions. If your product must accept writes at a disconnected edge site, you are choosing among causal and weaker models whether you name them or not.
PACELC: the latency tax you pay every day
Daniel Abadi’s “Consistency Tradeoffs in Modern Distributed Database System Design” (IEEE Computer, February 2012) pointed out that partitions are rare, while the latency cost of consistency is paid on every request. PACELC reads: if there is a Partition, trade Availability against Consistency; Else, trade Latency against Consistency. Abadi classified default Dynamo, Cassandra and Riak as PA/EL, VoltDB/H-Store and Megastore as PC/EC, MongoDB at the time as PA/EC, and Yahoo’s PNUTS as PC/EL.
The latency side is quantifiable from first principles. Suppose replicas sit in three regions with about 70 ms round-trip time between any two. These numbers are illustrative, not measured. A linearizable read through a leader that must confirm its leadership with a quorum costs one cross-region round trip, roughly 70 ms, when the client is far from the leader. A lease-based read at the leader costs only the client-to-leader hop, but relies on clocks. A follower read in the client’s own region costs a few milliseconds and may be stale by the replication lag. Strict serializable commits in Spanner add commit wait, which the 2012 OSDI paper reported as typically bounded by a TrueTime uncertainty of roughly 1 to 7 ms. Every one of these consistency models has a price tag of this kind.
What real systems claim, translated onto the map
The table below translates documented guarantees into Figure 1’s vocabulary. Every row maps a product onto the consistency models above and cites a vendor or project source current as of November 2026. Always check the version you run, because defaults move.
| System | Default | Strongest option | Notes from the documentation |
|---|---|---|---|
| Google Spanner | External consistency for read-write transactions | Same | Google defines external consistency as stricter than serializability and calls linearizability a special case; implemented with TrueTime and commit wait |
| CockroachDB | SERIALIZABLE | SERIALIZABLE | READ COMMITTED available, allows lost updates and write skew; Cockroach Labs states it is “not quite” strict serializable and names the gap “causal reverse” |
| Amazon DynamoDB | Eventually consistent reads | ConsistentRead=true on tables and LSIs |
GSIs and Streams are eventually consistent only; strongly consistent reads cost twice as much; global tables offer MREC or MRSC |
| Apache Cassandra | Per-operation consistency level | Lightweight transactions with Paxos, SERIAL | QUORUM reads and writes overlap so the latest write is read when W + R > RF; LWTs are documented as linearizable |
| etcd | Linearizable reads | Linearizable | KV operations are strictly serializable; serializable reads are an opt-in that may be stale; watches are not linearizable |
| MongoDB | Read concern local |
linearizable on the primary, single document |
Causal consistency in sessions requires majority read and write concern; linearizable reads need maxTimeMS |
A few rows deserve unpacking because the documentation is subtle.
Spanner is the cleanest case: read-write transactions are strictly serializable, which Google calls external consistency. The mechanism is that a transaction’s commit timestamp is chosen from TrueTime and the leader waits out the uncertainty interval before making the commit visible, so any transaction that starts later in real time gets a later timestamp.
CockroachDB runs SERIALIZABLE by default and serves “non-stale” reads under both SERIALIZABLE and READ COMMITTED, per its documentation. Its engineering blog post on the consistency model is candid that “CockroachDB doesn’t quite offer strict serializability,” because hybrid logical clocks with a configured maximum clock offset (500 ms by default at the time of that post) cannot always order two causally unrelated transactions on different nodes in real-time order. The anomaly requires three overlapping transactions and is rarely visible to applications, but it is not nothing (Cockroach Labs on its consistency model).
DynamoDB defaults to eventually consistent reads; GetItem, Query and Scan accept ConsistentRead to return data “reflecting the updates from all prior write operations that were successful.” Global secondary indexes and Streams support only eventual consistency. For global tables, the default multi-Region eventual consistency mode typically replicates within a second, while multi-Region strong consistency replicates synchronously to another Region before acknowledging the write (DynamoDB read consistency).
Cassandra exposes consistency per request. The project documentation says QUORUM requires “a majority (n/2 + 1) of the replicas,” and that when W + R > RF at least one replica participates in both the write and the read, so the latest write is read. That overlap is not linearizability. Without additional mechanisms, concurrent writes resolve by timestamp, and a failed write that reached one replica can surface later through read repair. For compare-and-set semantics Cassandra offers lightweight transactions built on Paxos, which DataStax documents as providing linearizable consistency for the affected partition.
etcd is the textbook linearizable store. Its API guarantees page says KV operations “are atomic and occur in a total order, consistent with real-time order,” that linearizable reads are the default, and that serializable reads “may access stale data with respect to quorum.” It also states that “etcd does not ensure linearizability for watch operations,” which matters for every Kubernetes controller that reacts to watch events (etcd API guarantees).
MongoDB separates durability (write concern) from visibility (read concern). Its documentation says causally consistent sessions guarantee read-your-writes, monotonic reads, monotonic writes and writes-follow-reads, but only for operations using majority read and write concern. The linearizable read concern works only on the primary, only for queries that uniquely identify one document, and only combined with majority writes, and the docs advise always setting maxTimeMS because the read can otherwise block if a majority is unreachable.
Weaker Consistency Models in Practice: Sequential, Causal and Eventual
The lower half of the single-object branch of consistency models is where most edge, mobile and IoT systems live, so it deserves its own treatment.
Sequential consistency: mostly a hardware and memory-model concept
Among consistency models, sequential consistency is rarely the advertised guarantee of a distributed database, because once you pay to agree on a total order, adding the real-time constraint is usually cheap. It survives mainly in processor and language memory models. Java and C++ both promise sequentially consistent behaviour for data-race-free programs that use their synchronisation primitives correctly, and x86’s total store order is a well-known relaxation of it. For distributed system design, the useful lesson is the non-composability result: a system built from sequentially consistent parts is not automatically sequentially consistent.
Causal consistency: the strongest model that survives partitions
Causal consistency, formalised for shared memory as “causal memory” by Ahamad and colleagues in 1995, requires that writes which are causally related be seen by every process in the same order. “Causally related” means one write happened before another in Lamport’s sense, through the same process or through a read of the earlier write. Concurrent writes may appear in different orders at different replicas.
Implementations track causality with metadata. Per-client dependency lists, vector clocks and hybrid logical clocks are the common tools, and a replica delays making a write visible until every write it depends on is visible. Our explainer on hybrid logical clocks and vector clocks for event ordering shows the metadata in detail. The cost is metadata size and visibility delay, not cross-region round trips, which is why causal consistency suits geo-distributed and offline-first designs.
The session guarantees introduced by Terry and colleagues for the Bayou project in 1994 (read-your-writes, monotonic reads, monotonic writes and writes-follow-reads) are the user-facing slices of causality. Together, they give each client a coherent view of its own history. MongoDB’s causally consistent sessions package exactly these four, which makes them a useful reference implementation.
Eventual consistency: a liveness property, not a safety property
Eventual consistency says that if writes stop, all replicas eventually converge to the same value. It constrains nothing about what a read returns in the meantime, which is why Jepsen’s map treats it as outside the safety hierarchy. A system that returned random values until writes stopped would technically qualify.
In practice, “eventual” systems add structure. Strong eventual consistency, the property conflict-free replicated data types provide, guarantees that any two replicas that have received the same set of updates are in the same state, with no rollback. That turns convergence from a hope into a deterministic merge. Our guide to CRDTs for digital twin synchronization and offline-first edge state walks through counters, registers and sets. The combination of causal delivery plus CRDT merge is the strongest practical design for a site that must keep writing through a WAN outage.
A worked IoT example: one twin, three consistency needs
Consider a digital twin of a packaging line. It has three kinds of state, and each wants a different consistency model.
The configuration that says which recipe a machine runs is a control-plane value. Two operators must never both believe they own the change, and a controller must never act on a recipe that was already superseded. That is a linearizable key in etcd or a similar consensus store, with a lease or fencing token for ownership.
The production order and inventory records carry invariants across rows, such as “allocated material never exceeds stock.” They want serializable transactions; if auditors compare timestamps with external events, they want strict serializability.
The telemetry and operator annotations captured on a tablet at the line must keep working when the plant’s WAN link drops. They need causal consistency so that a note about a fault never appears before the fault itself, and CRDT merge so that two offline edits converge. Forcing this layer onto the linearizable store would make the line’s tablets unusable during every outage.
Trade-offs, Gotchas, and What Goes Wrong
The anomalies above are well understood. The failures that reach production usually come from the seams between consistency models, not from the consistency models themselves.

Figure 4: Choosing the weakest model that preserves your invariants. Start with whether the invariant spans keys, then whether order must match real time, then whether the component must keep accepting writes during a partition.
Caches silently downgrade everything. A strictly serializable database behind a read-through cache with a 30-second TTL gives clients, at best, a bounded-staleness read. Invalidate-on-write races are the usual culprit: a reader populates the cache with an old value after the writer’s invalidation has already run.
Read replicas break read-your-writes. A user saves a profile on the primary, the page redirects, and the next read hits a replica that has not applied the change. The fix is session stickiness, a causal token such as a log sequence number, or routing that user’s reads to the primary for a short window.
Watches and change streams are weaker than the store. etcd states plainly that watches are not linearizable. Any controller that reads the store, then reacts to a watch event, must compare revisions rather than assume the event is newer than its last read.
“Serializable” is a label, not a proof. Oracle’s SERIALIZABLE and the historic behaviour of several databases are snapshot isolation. Jepsen analyses have repeatedly found real systems violating their documented models under partitions and clock faults. Test the guarantee you depend on with your workload.
Clocks are part of the consistency argument. Lease-based linearizable reads, Spanner’s commit wait and CockroachDB’s uncertainty intervals all rely on bounded clock error. A VM pause or a stepped NTP clock that breaks the bound can break the guarantee. Treat clock monitoring as a correctness requirement, not an observability nice-to-have.
Quorum overlap is not linearizability. W + R > N ensures overlap, not real-time order. Sloppy quorums, hinted handoff, last-write-wins on skewed clocks and partially failed writes can all produce histories that no linearizable register would allow.
Over-strong consistency has its own failure mode. Putting high-rate telemetry into a consensus store turns every network blip into a write outage and makes the leader the bottleneck. Choosing stronger consistency models than the invariant needs buys latency and unavailability for no correctness gain.
Practical Recommendations
Start from invariants, not from products or from the names of consistency models. Write down the rules your data must never break, then classify each one. An invariant over a single key that must reflect the latest acknowledged write needs linearizability. An invariant across keys needs serializable transactions, and strict serializability if external parties compare your ordering against real time. A requirement to keep writing during a partition rules out both and leads to causal consistency with explicit merge semantics.
Next, translate every component’s documentation into a node on Figure 1, including caches, replicas, CDC pipelines and watch APIs. The weakest component on a request’s path sets the effective guarantee. Finally, verify with tests. Record histories under fault injection and check them, either with an off-the-shelf checker or a domain-specific sketch like the one above.
Checklist:
- List each invariant and mark it single-key, multi-key, or partition-tolerant.
- Use linearizable reads only where staleness causes a wrong decision, and use follower or snapshot reads elsewhere.
- Prefer SERIALIZABLE (or SSI) for transactions that protect cross-row invariants; use
SELECT ... FOR UPDATEdeliberately under weaker levels. - Carry a causal token (LSN, HLC timestamp or session token) across service hops that need read-your-writes.
- Use CRDTs or explicit merge functions for state that must be writable offline.
- Alert on clock offset and replication lag as correctness signals.
- Run Jepsen-style fault-injection tests on any path whose guarantee you rely on.
Frequently Asked Questions
What is the difference between linearizability and serializability?
Linearizability is a guarantee about single operations on single objects: each operation appears to happen instantly between its call and its return, so any operation that starts after another finishes sees its effect. Serializability is a guarantee about transactions over many objects: the outcome equals some one-at-a-time execution, but that order may disagree with real time. A serializable system may return stale data; a linearizable key-value store may allow write skew across keys. Strict serializability combines both properties and is what Spanner calls external consistency.
Is strict serializability the same as external consistency?
In practice, yes. Strict serializability requires that transactions appear to execute one at a time in an order consistent with real time: if one transaction commits before another begins, it is ordered first. Google’s Spanner documentation uses the term external consistency for this property and describes it as stricter than serializability, with linearizability as a special case for single operations. The academic literature generally treats the two names as equivalent. When comparing vendors, check whether the real-time guarantee applies to all transactions or only to reads within a region.
Does the CAP theorem mean distributed databases cannot be consistent?
No. CAP, as proven by Gilbert and Lynch in 2002, says a system cannot be both linearizable and available to every non-failed node during a network partition. Systems like etcd, Spanner and CockroachDB choose consistency and refuse some requests on the minority side of a partition. Outside partitions, they are both consistent and available. CAP also says nothing about latency, which Abadi’s PACELC framing adds: even without partitions, stronger consistency typically costs more round trips. Most real design decisions are latency decisions, not partition decisions.
When is eventual consistency good enough?
Eventual consistency is good enough when a stale read cannot cause an irreversible wrong decision and concurrent writes can be merged deterministically. Telemetry dashboards, counters, shopping carts, presence indicators and many digital twin annotations fit. It is not enough for uniqueness constraints, balances, inventory allocation or leader ownership. Even when eventual consistency is acceptable, add session guarantees such as read-your-writes so users see their own changes, and use CRDTs or explicit merge rules rather than last-write-wins on wall clocks.
What is causal consistency and which databases support it?
Causal consistency guarantees that if one write could have influenced another, every replica shows them in that order, while unrelated concurrent writes may appear in different orders. It is the strongest broadly useful model that can remain available, with sticky clients, during a partition, according to Bailis et al.’s highly available transactions analysis. MongoDB offers causally consistent client sessions when you use majority read and write concerns. Many edge and mobile sync engines implement causal delivery with vector clocks or hybrid logical clocks, often combined with CRDTs.
Is snapshot isolation serializable?
No. Snapshot isolation prevents dirty reads, non-repeatable reads and lost updates, but it allows write skew, where two transactions read overlapping data and write disjoint rows, jointly breaking an invariant. PostgreSQL’s REPEATABLE READ level is snapshot isolation; its SERIALIZABLE level adds Serializable Snapshot Isolation, which detects the dangerous read-write dependency patterns and aborts a transaction. Some databases have historically labelled snapshot isolation as SERIALIZABLE, so verify the behaviour, not the name, using a write skew test like the on-call example.
Further Reading
- Raft vs Paxos: leader election, consensus and failure modes — how linearizable logs and reads are actually built.
- Hybrid logical clocks and vector clocks for event ordering in distributed IoT — the metadata behind causal consistency.
- CRDTs for digital twin synchronization and offline-first edge state replication — making eventual consistency converge deterministically.
- MVCC and transaction isolation levels: snapshot isolation, write skew and SSI — the single-database implementation view of isolation.
- Two-phase commit explained — how atomic commit across shards interacts with isolation.
- Maurice Herlihy and Jeannette Wing, “Linearizability: A Correctness Condition for Concurrent Objects”, ACM TOPLAS, 1990.
- Jepsen, Consistency Models — the reference map and per-model definitions.
By Riju — about
