Sven Erik Matzen

Software Architect | Cloud & Security Expert | AI-enabled Solutions

As If There Were Only One Copy – Linearizability, Jepsen, and What "Strongly Consistent" Really Promises

Software Architecture · 2026-11-29

EU label: fully AI-generated content Fully AI-generated article (no prior review).

🎧 Listen to this article

The Hook

Alice changes her profile picture in an app. The app reports "Saved". She calls Bob: "Take a look, my new picture." Bob reloads the page – and sees the old picture. A few seconds later, the new one appears.

Is that a bug? The honest answer is: it depends on what the system promised. If the documentation says "eventual consistency", everything is fine – at some point Bob will see the new picture. If it says "linearizable" or "strongly consistent", the system has broken its promise. Alice's write had completed before Bob's read began – and a linearizable system must respect exactly this order in real time.

Linearizability is one of the most frequently cited and most frequently misunderstood consistency models. This article explains what exactly it requires, why it is local and yet expensive, why checking it is hard – and how the Jepsen testing project measures real databases against this yardstick.

The Core Concept: One Moment Between Invocation and Response

The term was coined by Maurice Herlihy and Jeannette Wing in 1990 in "Linearizability: A Correctness Condition for Concurrent Objects" (ACM Transactions on Programming Languages and Systems, vol. 12, no. 3, pp. 463–492; a preliminary version appeared in 1987 at the POPL symposium). The idea is strikingly simple: every operation on a shared object has an invocation and a response. In between lies a time interval during which the system works – perhaps across several replicas, network round trips, and locks. Linearizability requires that each operation appears to take effect at a single instant somewhere within this interval, as the authors put it in their abstract.

Formally, this means: for every observed execution history there must be a valid sequential history – a sequence in which the operations run one after another and the object follows its normal, non-concurrent specification – and this sequence must preserve the real-time order. The Jepsen project summarizes the real-time condition like this: if operation A completes before operation B begins, then B must logically take effect after A. If two operations overlap in time, the system may order them either way.

For developers, this means: I am of the opinion that linearizability is best remembered as "the illusion of a single copy". No matter how many replicas there are, from the outside the object behaves like a single variable in the memory of a single computer.

Example 1: The Queue That Delivers Too Early

Herlihy and Wing illustrate their concept with a FIFO queue. Two processes enqueue the elements x and y. The enqueue of x has fully completed before that of y begins. Afterwards, someone dequeues an element – and gets y.

This history is not linearizable: because x was demonstrably enqueued first, a FIFO queue would have had to return x. It is quite different when the two enqueues overlap in time: then the system may order y first, and the result y is correct. Equally non-linearizable is a history in which the same element is dequeued twice – no sequential queue can do that.

The example shows the core: linearizability does not judge the implementation, but the observable history. All you need are invocation times, response times, and results.

Example 2: Locality – the Underrated Superpower

Herlihy and Wing place particular emphasis on what sets linearizability apart from related models: it is a local property. A system of many objects is linearizable if and only if each individual object is linearizable (Theorem 1 of the paper). According to the authors, this allows concurrent systems to be designed in a modular fashion: you can build and prove a linearizable queue and a linearizable register independently of each other, and their combination is automatically linearizable.

The comparison models do not have this property:

  • Sequential consistency (after Lamport) only requires that the history be equivalent to a valid sequential history – without preserving the real-time order between different processes. It is therefore weaker than linearizability, and the paper shows with a counterexample that it is not local: two objects that are each sequentially consistent do not necessarily form a sequentially consistent system together.
  • Serializability and strict serializability from the database world are, according to Herlihy and Wing, not local either, and serializability is inherently blocking.

Conversely, linearizability can be seen as a special case of strict serializability: strict serializability for transactions consisting of exactly one operation on exactly one object. Jepsen recommends accordingly: anyone who needs guarantees across multiple objects should ask for strict serializability; anyone who can do without real time but wants a common total order should ask for sequential consistency.

In addition, according to Herlihy and Wing, linearizability is nonblocking: the model itself never forces processes with total operations to wait for one another. Whether a concrete implementation blocks is a different question.

Example 3: The Price of Network Partitions – CAP, Precisely

At the PODC 2000 symposium, Eric Brewer conjectured in an invited talk that a web service cannot simultaneously guarantee consistency, availability, and partition tolerance. Seth Gilbert and Nancy Lynch (MIT) proved a formalized version in 2002 – and explicitly chose atomic, i.e. linearizable, consistency as their notion of "consistency". Availability, for them, means: every request received by a non-failing node must result in a response. Partition tolerance means: the network may lose arbitrarily many messages.

Their Theorem 1 states: in the asynchronous network model – without clocks, only with messages and local computation – it is impossible to implement a read/write object that is both available and atomically consistent in all fair executions (including those with message loss). Theorem 2 carries the impossibility over to the partially synchronous model when arbitrary messages can be lost. There, however, a practical compromise exists: algorithms that return atomic data as long as all messages arrive, and return stale values only when messages are lost.

The version of the CAP theorem proved by Gilbert and Lynch is therefore not a vague triangle from which you pick "two out of three", but a precise statement about atomic, i.e. linearizable, consistency and full availability. Brewer's original conjecture, by contrast, spoke informally of "consistency". Jepsen puts the consequence like this: linearizability can be neither "totally" nor "sticky" available – in a partition, some or all nodes may be unable to make progress. Sufficiently weak models such as causal consistency, on the other hand, are sticky available, i.e. for clients that always talk to the same servers; sequential consistency, although weaker than linearizability, is not.

Model Real-time order Local (per Herlihy & Wing) Availability under partition (per Jepsen)
Strict serializability yes, across multiple objects no neither total nor sticky
Linearizability yes, per object yes neither total nor sticky
Sequential consistency no, only a common order no neither total nor sticky
Causal consistency no, only causal order – sticky available

Jepsen arranges the models as a chain: strict serializability (a multi-object model) implies linearizability, which implies sequential consistency, which implies causal consistency.

Example 4: The Price Even Without Partitions

One might think: as long as the network works, linearizability is free. Hagit Attiya and Jennifer Welch showed in 1994 in "Sequential Consistency versus Linearizability" (ACM Transactions on Computer Systems, vol. 12, no. 2, pp. 91–122) that this is not so. Their model: messages take between d − u and d time units, so u is the uncertainty of the delay.

With only approximately synchronized clocks, they prove lower bounds for linearizable read/write registers: in the worst case, a read takes at least u/4 and a write at least u/2 (each under assumptions about the number of reading and writing processes). For sequential consistency, by contrast, there are algorithms in which one of the two operations is answered immediately, without any waiting time. Their conclusion for this case: linearizability is more expensive than sequential consistency. With perfectly synchronized clocks, both are equally costly; then, for sequential consistency, the sum of the response times of read and write is at least d.

The lesson: the costs of strong consistency lie not only in the exceptional case of a partition, but also in the latency of every normal call – and they depend on how well you know time and delays. I am of the opinion that this makes it worthwhile to look at systems that model time uncertainty explicitly – such as Spanner with TrueTime (see Clocks That Know Their Own Uncertainty: Google Spanner, TrueTime, and Mastering Time in the Cloud).

Example 5: Why Checking Is So Hard

If linearizability depends only on the observed history, it ought to be easy to test: record the operations, search for a matching sequential order, done. Unfortunately, it is exactly this search that is hard. Phillip Gibbons and Ephraim Korach, in "Testing Shared Memories" (SIAM Journal on Computing, vol. 26, no. 4, pp. 1208–1244, 1997), presented by their own account the first formal study of how to test memory systems for consistency. Gavin Lowe (Oxford) summarizes their result in his work on linearizability testing as follows: checking a single history for linearizability is NP-complete in general. For the case of a register with a fixed number of processes, however, Gibbons and Korach showed, according to Lowe, an algorithm in O(n log n).

Early practical approaches such as Wing and Gong's tree-search algorithm recorded a history and searched for a matching sequential order. Lowe notes that this approach often performs poorly and fails to terminate in a reasonable amount of time; in his own experiments, the tree-search variant failed to finish in time in some runs, while a variant he developed using graph search was practical. Good checkers therefore rely on heuristics, small histories, and clever decomposition – not least on locality, which allows each object to be checked separately.

Example 6: Jepsen – Consistency Promises Under Stress

For years, Kyle Kingsbury has been testing distributed databases with the Jepsen project: clients perform concurrent operations while Jepsen injects network partitions, process crashes, and clock jumps; afterwards a checker compares the recorded history against the promised consistency model.

An instructive example is the analysis of etcd 3.4.3 from January 30, 2020. Result: the key-value operations appeared to be strict serializable – Jepsen observed nothing but strict-serializable behavior for reads, writes, and even multi-key transactions. The analysis, however, describes etcd's locks as fundamentally unsafe; it noted that etcd locks, like all distributed locks, do not provide mutual exclusion. In a test with a two-second lease duration and regularly injected process pauses, the loss of about 18 % of acknowledged updates could be induced. The lesson: a correct consistency model for data does not automatically carry over to primitives built on top of it.

For transactions, Kingsbury and Peter Alvaro developed the checker Elle ("Elle: Inferring Isolation Anomalies from Experimental Observations", arXiv 2020; Proceedings of the VLDB Endowment, vol. 14, no. 3, pp. 268–280). Elle infers an Adya-style dependency graph from the transactions observed by clients and, according to the abstract, can detect every anomaly in Adya's formalism, except for predicates. The trick: instead of blindly searching for a matching order, you design the test data so that the order can be read off from the results.

Framework: Four Questions for Every "Strongly Consistent" System

  1. Which model exactly? "Strong consistency" is not a uniformly defined technical term. Linearizable per key? Strict serializable across transactions? Or merely sequentially consistent?
  2. For which operations? Do the guarantees also apply to reads from followers, to caches, to locks and watches – or only to the main path?
  3. What happens in a partition? A linearizable system must reject requests or make them wait on at least one side. Anyone promising the opposite is, according to Gilbert and Lynch, promising the impossible.
  4. What does it cost in normal operation? How many network round trips does a read need? Is time (leases, clocks) used as a shortcut – and what happens when the clock is wrong?

The Limits

Linearizability is not a cure-all. It speaks about individual objects; for invariants across multiple records – such as account balances – you need transactions and strict serializability. Nor does it guarantee fairness, availability, or progress in the face of failures. And tests such as Jepsen can find violations, but can never prove that a system is correct; a passed test only shows that no error occurred in the tested scenarios.

I am of the opinion that many applications do not need linearizability at all. Causal consistency or "read your writes" cover many user expectations – Alice sees her own new picture – and are more likely to remain available during partitions. What matters is making the choice consciously.

The Central Takeaway

  • Linearizability means: every operation appears to happen at one instant between invocation and response, and the real-time order of completed operations is preserved.
  • It is local: if you build every object to be linearizable, you get a linearizable overall system – sequential consistency and serializability do not offer this.
  • It has a price: during partitions, giving up full availability (Gilbert & Lynch); in normal operation, measurable minimum latencies when delays are uncertain (Attiya & Welch).
  • Checking is NP-complete in general; practical checkers such as Jepsen's work with heuristics, small histories, and cleverly chosen test data.
  • Call to action: for the most important database in your system, look up which consistency model it exactly promises, and check whether a Jepsen analysis of it exists.

Cross-References in the Vault

Food for Thought

Think of the last situation in which a user of your system had saved something "just now" and did not see it immediately. Would that be a bug in your system – or permitted behavior? And do your users know that too?

Fact Check

Automated AI check against primary sources; no human expert review.

72 claims were checked (24 hard facts, 12 quotes or paraphrases, 10 source attributions, 26 synthesis claims) by a separate checking agent that retrieved the sources itself in this run. 11 passages were softened, made more precise, or removed; no outright false claims were found. The most important corrections:

  • The etcd finding of about 18 % lost updates applies to a test with short leases and deliberately injected process pauses – the draft had omitted this condition.
  • The statement "weaker models are sticky available" contradicted the article's own table: sequential consistency is weaker than linearizability but, according to Jepsen, is not sticky available either.
  • The precision of the CAP theorem was attributed to Gilbert and Lynch's formalization, not to Brewer's informal conjecture; a sentence about Spanner not supported by the sources was marked as the author's own assessment.

Sources and Further Reading

  1. Herlihy, M. P., Wing, J. M. (1990): Linearizability: A Correctness Condition for Concurrent Objects. ACM Transactions on Programming Languages and Systems 12(3), pp. 463–492. https://www.cs.columbia.edu/~wing/publications/HerlihyWing90.pdf
  2. Gilbert, S., Lynch, N. (2002): Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services. https://www.comp.nus.edu.sg/~gilbert/pubs/BrewersConjecture-SigAct.pdf
  3. Attiya, H., Welch, J. L. (1994): Sequential Consistency versus Linearizability. ACM Transactions on Computer Systems 12(2), pp. 91–122. https://people.engr.tamu.edu/j-welch/papers/tocs94.pdf
  4. Gibbons, P. B., Korach, E. (1997): Testing Shared Memories. SIAM Journal on Computing 26(4), pp. 1208–1244. DOI 10.1137/S0097539794279614. https://cris.bgu.ac.il/en/publications/testing-shared-memories-2/
  5. Lowe, G.: Testing for Linearizability. Concurrency and Computation: Practice and Experience (preprint). https://www.cs.ox.ac.uk/people/gavin.lowe/LinearizabiltyTesting/paper.pdf
  6. Kingsbury, K., Alvaro, P. (2020): Elle: Inferring Isolation Anomalies from Experimental Observations. arXiv:2003.10554; PVLDB 14(3), pp. 268–280. https://arxiv.org/abs/2003.10554
  7. Kingsbury, K. (2020): Jepsen: etcd 3.4.3. https://jepsen.io/analyses/etcd-3.4.3
  8. Jepsen: Consistency Models – Linearizable. https://jepsen.io/consistency/models/linearizable and https://jepsen.io/consistency/models

← All articles