Notesdistributed🌱 seedling
Sequential Consistency
Also: Sequentially Consistent
The result is as if all operations ran in one total order that every client agrees on, with each client's operations in the order it issued them. Unlike linearizability, that order may lag behind real time.
Why it exists
Real-time ordering forces coordination on every read. Dropping it lets replicas serve reads locally (possibly stale) while still giving everyone the same history. It was first defined for multiprocessor memory.
How it works
- One global order of operations, consistent with each client's program order.
- A client may be served old state, but once it has seen a write it never sees an earlier state.
- Typically built from a single ordered log (Total Order Broadcast) that replicas apply in sequence; reads come from whichever replica the client uses.
- A history with "B reads 1, then C, starting later, reads 0" is sequentially consistent (order C's read first) but not linearizable.
Trade-offs
| Gains | Costs |
|---|---|
| local reads, no per-read round trip | stale reads |
| everyone agrees on one order | side channels expose the lag (B tells C) |
| simpler than causal metadata | still unavailable on some nodes during a partition |
In practice
- ZooKeeper: writes are linearizable and each client's requests run in FIFO order, but reads are served by the local replica and may be stale. Call
syncbefore a read that must be current.
Pitfalls
- It isn't local: two sequentially consistent objects together needn't be sequentially consistent.
- Relying on it when users or services communicate outside the store; that's exactly where real time matters.
Connections
- Part of
- Consistency Model
- Contrasts with
- Causal ConsistencyLinearizability
- In real systems
- ZooKeeper
Recall
These cards are also in your review deck, scheduled with spaced repetition.