We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
2 system design questions lean on this idea. Each walks through the full answer.
System Design Masterclass · Consistency Models
Free preview: the first 2 parts of this 8-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Consistency Models
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
Leslie Lamport defined sequential consistency in 1979: the result of any execution is the same as if all operations were executed in some sequential order, and each processor operations appear in the order specified by its program.
In plain terms: there is a single global ordering of all operations that every node agrees on. Client A operations appear in order. Client B operations appear in order. The interleaving is arbitrary but consistent across all observers.
Sequential consistency is stronger than causal (orders even unrelated operations) but weaker than linearizability (does not require real-time ordering).
Sequential consistency, operations can be reordered as long as each client program order is preserved. Two operations might be reordered globally even if one completed before the other started in real time.
Linearizability, operations must respect real-time order. If A completes before B starts, A must appear before B in the global order.
| Property | Sequential | Linearizable |
|---|---|---|
| Per-client order | Preserved | Preserved |
| Real-time order | Not required | Required |
| Cost | Lower (no clock sync) | Higher (coordination) |
| Example | ZooKeeper reads | ZooKeeper writes |
The practical difference: with sequential consistency, you might read a stale value even though a more recent write has completed. With linearizability, you cannot.