Consistency Models Spectrum
Linearizable, sequential, causal, eventual: name the exact model and its coordination cost, and always pick the weakest model that is still correct for the data.
Name the exact point, not the ends
"Strongly consistent" and "eventually consistent" are the two phrases most people know, and they are not enough. Between them sits a spectrum, and a senior engineer names the exact point rather than waving at the ends.
Linearizability is the strong end. Every operation appears to take effect instantaneously at some point between its invocation and its response, and that single point respects real-time order: if write B started after write A returned, every reader sees them in that order. The system behaves as if there is one copy of the data. This is what lets you build a unique-username check, a distributed lock, or a leader election, because "did anyone already take this?" has a single global answer. The cost is coordination: a leader or a quorum, and round trips to agree on order.
Sequential consistency relaxes the real-time part. All clients agree on one total order, and each client's own operations keep their program order, but that global order need not match wall-clock reality. Cheaper than linearizable, and enough for many caches, but it can surprise you when two users compare notes out of band ("I posted first, why is mine below yours?").
Causal consistency keeps only the orderings that matter: if event A causally influenced B (you read a post, then reply to it), everyone sees A before B. Operations with no causal link can appear in different orders on different replicas. The crucial property, from the COPS and Bayou research lines: causal consistency is the strongest model you can provide while staying available under a network partition. Anything stronger forces you to block or reject writes when the network splits.
Eventual consistency promises only that if writes stop, replicas converge. Along the way you see stale reads, reordered updates, and (without conflict handling) lost writes. Cheapest to run, highest availability: shopping-cart-scale and like-count-scale systems live here.
Pick the weakest model that is still correct for each piece of data.
Eventual: converges. Promises only that replicas converge once writes stop; along the way you see stale reads, reordered updates, and (without conflict handling) lost writes. Cheapest to run, highest availability: like counts and shopping carts live here.
Interview nuance: the coordination cost rises monotonically to the left. Stronger models need leaders, quorums, or waiting, which costs latency and availability. The design skill is picking the weakest model that is still correct for the specific data.
One more axis people conflate. Replication consistency (this spectrum: how up-to-date are the copies) is not the same as ACID isolation (serializable, snapshot, read-committed: how concurrent transactions interleave). Spanner is linearizable and serializable; a system can be one without the other. Naming which axis you mean is a fast credibility signal.
Recap: name the specific model (linearizable, sequential, causal, eventual) and its coordination cost, remember causal is the strongest model available under partition, keep replication consistency separate from ACID isolation, and always reach for the weakest model that is still correct.
Apply
Your turn
The task this lesson builds to.
Design the read path for a bank balance versus a social like-count, and for each pick the weakest consistency model that is still correct, justifying the choice.
Think about
- What separates linearizable, sequential, causal, and eventual?
- Why is causal the strongest model available under partition?
- Why is replication consistency a different axis from ACID isolation?
Practice
Make it stick
A second problem on the same idea, so it survives past today.
Choose consistency models for Amazon's checkout flow at Prime Day scale (tens of thousands of orders/sec) across three surfaces: the shopping cart, the 'only 2 left in stock' inventory badge, and the final 'place order' decrement of real inventory. Justify the weakest correct model for each and name the anomaly you are accepting.
Think about
- Which surface is advisory UI and which holds a hard invariant?
- How do you scope the expensive coordination to a single hot key?
- What spreads contention when one SKU becomes the doorbuster?