Skip to content

Consistency models

Linearizable, sequential, causal, session guarantees and eventual: what each forbids, how to spot a violation, and how to pick the weakest one that is safe.

30 min9 steps

By the end you can
  • Order the common consistency models by strength and say what each one forbids
  • Identify which guarantee a concrete history of reads and writes violates
  • Choose the weakest model that meets a product requirement, and implement session guarantees with log positions
  • Estimate the chance a read misses a recent write when read and write sets need not overlap

A consistency model is a contract

Client AStoreClient Bwrite x=1 (t=0)ok (t=10 ms)read x (t=12 ms)x = 0 (stale)
Linearizable: once a write returns, every later read sees it or newer.

Client A's write x = 1 returns at t = 10 ms. Client B, on another continent, starts a read of x at t = 12 ms and gets the old value 0. Which model does this history violate?

Answer this step to continue.