100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Architecture

Consistency Models

Consistency models define the contract about what values reads may return after concurrent writes, ranging from strict linearizability to loosely-ordered eventual consistency.

Distributed Systems TheoryAdvanced10 min readJul 9, 2026
Analogies

Consistency Models

A consistency model is a contract between a distributed data store and its clients about what results a read is allowed to return relative to prior and concurrent writes. It is easy to think of 'consistency' as a single on/off property, but in practice it is a spectrum with well-defined points along it, each with different guarantees, different implementation costs, and different impacts on latency and availability. At the strong end, linearizability makes a distributed system behave as if there were only a single copy of the data, with every operation appearing to take effect instantaneously at some point between its start and end. At the weak end, eventual consistency only guarantees that if writes stop, all replicas will eventually converge — with no promise about how long that takes or what an in-flight read might see. Choosing the right model for each piece of data is one of the most consequential decisions in distributed systems design because it directly trades off correctness guarantees against latency and availability.

🏏

Cricket analogy: Consistency models are like reading a scoreboard: a stadium's giant screen (linearizable) shows the exact live score instantly, while a fan's delayed radio broadcast (eventual) only guarantees the score will match up eventually, with no promise of when during a rain delay.

Strong Consistency: Linearizability and Sequential Consistency

Linearizability is the strongest common consistency model: it guarantees that every operation appears to execute atomically at some instant between its invocation and its completion, and that all clients see operations in an order consistent with real (wall-clock) time. This means once a write completes, every subsequent read by any client, anywhere, must see that write or a later one — there is no window where a client can observe stale data. Sequential consistency is slightly weaker: all clients see operations in the same order, but that order does not have to match real-time invocation order, only the program order of each individual client. Linearizability is what most people mean colloquially by 'strong consistency,' and it typically requires consensus protocols or a single authoritative source of truth per piece of data, which adds latency because writes must be acknowledged by a quorum before they are considered durable.

🏏

Cricket analogy: Linearizability is like the third umpire's decision counting the instant it's given, visible identically to every viewer in real time; sequential consistency is more like commentators agreeing on the order of wickets in their own broadcast without syncing to the exact real-time moment.

Causal Consistency and Read-Your-Writes

Between the strong and weak extremes sit useful intermediate models. Causal consistency guarantees that operations which are causally related (e.g., a reply to a comment) are seen by every observer in the same order, while concurrent, causally-unrelated operations may be seen in different orders by different clients — this is cheaper to implement than linearizability because it doesn't require global ordering, only tracking of causal dependencies (often via vector clocks). Session guarantees like read-your-writes (a client always sees its own prior writes), monotonic reads (a client never sees data go 'backwards' in time), and monotonic writes (a client's writes are applied in the order it issued them) are practical, client-scoped consistency properties that make eventually-consistent systems feel much less surprising to end users, even without paying for global strong consistency.

🏏

Cricket analogy: Causal consistency ensures everyone sees a batsman's century announced before the crowd's celebratory chant that references it, even if unrelated events like a drinks-break tweet can appear in any order; a player checking the scoreboard always sees their own recorded run immediately.

text
Consistency spectrum (strongest to weakest):

Linearizability
  -> every op appears instantaneous, matches real-time order
Sequential Consistency
  -> global total order matching each client's program order
Causal Consistency
  -> causally related ops ordered the same for everyone;
     concurrent ops may differ in order across observers
Read-Your-Writes / Monotonic Reads / Monotonic Writes
  -> per-client session guarantees, not global ordering
Eventual Consistency
  -> replicas converge IF writes stop; no ordering or
     timing guarantee otherwise

Cost/latency generally increases as you move up this list;
availability and read/write latency generally improve as you
move down it.

Amazon DynamoDB's original design (2007) popularized 'eventually consistent reads' as the default, with an opt-in for 'strongly consistent reads' at higher latency cost — letting each API call choose its point on the spectrum. Similarly, Facebook/Meta's TAO graph store offers read-your-writes within a region (via 'sticky' routing to the same cache tier) while accepting weaker guarantees across regions, illustrating how production systems mix models by scope rather than picking one globally.

Choosing a Model in Practice

The right consistency model depends on what an incorrect read actually costs the business. Inventory counts for a flash sale, bank balances, and distributed locks typically need linearizability or at least strong-enough guarantees to prevent overselling or double-spending. Social media likes, view counts, and non-critical denormalized caches can tolerate eventual consistency because a momentarily wrong number causes no real harm and self-corrects. Many systems implement 'tunable consistency,' where the client specifies per-request how many replicas must acknowledge a write (W) and how many must be read (R) — when W + R > N (total replicas), you get strong consistency for that operation; when W + R <= N, you get better latency/availability at the cost of possibly stale reads. This lets a single database serve both use cases from the same cluster.

🏏

Cricket analogy: Ball-tracking for an LBW review needs near-linearizable accuracy since a wrong call costs a wicket, but a live 'tweet count' widget on the broadcast can lag and self-correct with no real harm — broadcasters effectively tune how many camera feeds and reviewers must confirm before a call stands.

  • Consistency models form a spectrum, not a binary choice, from linearizability down to eventual consistency.
  • Linearizability guarantees every read reflects the most recent completed write, matching real-time order; it is the most expensive to provide.
  • Causal consistency preserves order only for causally related operations, offering a cheaper middle ground.
  • Session guarantees (read-your-writes, monotonic reads) improve perceived consistency for a single client without global ordering costs.
  • Eventual consistency guarantees convergence only if writes stop, with no bound on staleness during active writes.
  • Tunable consistency (quorum-based R/W settings) lets one database serve both strong and weak consistency needs per-request.

Practice what you learned

Was this page helpful?

Topics covered

#Architecture#SystemDesignStudyNotes#SoftwareEngineering#ConsistencyModels#Consistency#Models#Strong#Linearizability#StudyNotes#SkillVeris