Search DistillSys

Find a concept

Type at least two characters to search lessons, designs, papers, and interview prep.

Consistencyintermediate7 min read

Consistency Models

Choose the weakest consistency promise that still protects the product’s invariants and user expectations.

2–5 minute refresher
Mental model

A consistency model defines which histories clients are allowed to observe

30second
refresher
A consistency model constrains what values a read may return and how operations appear ordered. Stronger models simplify application reasoning; weaker models reduce coordination and often improve latency and availability.

The useful spectrum

  • Linearizable: each operation appears atomic and respects real-time order.
  • Sequential: all clients agree on one order, which need not match wall-clock order.
  • Causal: causes appear before their effects; unrelated writes may differ in order.
  • Session guarantees: one user sees read-your-writes or monotonic reads.
  • Eventual: replicas converge after writes stop, without promising when.

Explore replica visibility

Interactive lab

Consistency explorer

Write to one replica, propagate the version, and see what each read contract may return.

Possible readv1

Strong reads coordinate to return the latest committed version.

Decision guide

Key trade-offs

ChoiceWhat you gainWhat it costs
LinearizableSimple invariants and one current valueCoordination on the critical path
Causal / sessionIntuitive user journeys with less global coordinationMore metadata and narrower guarantees
EventualLow-latency local operation and availabilityStale reads, conflicts, and convergence logic
What happens if?

A user updates a profile then reads from a lagging replica

Eventual consistency may show the old profile. Read-your-writes can pin the session to a replica or carry a version token so the user does not move backward.
What happens if?

Two clients reserve the last item

A stale availability read is harmless only until both writes commit. Inventory requires an authoritative conditional write even if browsing remains eventually consistent.
Senior interview modeIs sequential consistency stronger than causal consistency?Show answer
Yes. Sequential consistency requires one total order observed by everyone. Causal consistency orders only operations related by cause and effect, allowing concurrent operations to appear differently.
#consistency#linearizability#eventual-consistency#causality