skip to content

Sequential consistency guarantees a single global order of operations that all processes agree on, but unlike linearizability it doesn't require that order to respect real-time (wall-clock) ordering across processes. Why would a system designer choose sequential consistency over linearizability, and what real-time anomaly does that trade-off allow?

level: seniorimportance: nice to knowfreq 30%

answer

  1. total order required, but no real-time constraint
  2. Lamport 1979 - originated in CPU memory models
  3. still needs global agreement = expensive in practice
  4. practically rare in distributed DBs vs causal/eventual
  5. anomaly: a completed write can still be invisible to a later real-time read

basics

~20 s

Sequential consistency is theoretically cheaper than linearizability because it doesn't need to match real clock time, just one consistent story everyone agrees on. The catch: an operation that really finished earlier in time might still appear to be seen after a later one starts, as long as everyone sees the same story.

solid answer

~50 s

Linearizability requires that if operation A completes in real time before operation B starts, every observer must see A before B, which forces coordination like waiting for consensus or quorum acknowledgment, adding latency especially across geo-distributed replicas. Sequential consistency drops the real-time requirement: it only requires that there exists some total order of all operations consistent with each process's own program order, and that all processes see that same total order - but that order doesn't have to match wall-clock time. This lets an implementation reorder or delay operations relative to real time as long as it stays internally consistent. The anomaly this permits: process P1 finishes write W at time T1, process P2 starts a read at T2 after T1, yet P2 can still legitimately see the pre-W value, because sequential consistency never promised that something over in real time must be visible - only that everyone agrees on one consistent ordering.

go deeper

for a junior

Not expected to have depth here; can be asked informally whether 'agreed order' and 'real time order' sound like the same thing.

for a middle

Should know the basic definition of sequential consistency, a single agreed order, but may not know it's expensive in practice.

for a senior

Should explain the real-time vs total-order distinction precisely and the practical cost point that it still needs global coordination.

for a principal

Should reason about why sequential consistency is rarely chosen in practice and recommend skipping it in favor of either linearizable or causal/eventual based on actual latency and business requirements.

## The definition Sequential consistency, introduced by **Leslie Lamport** in 1979 in the context of multiprocessor memory models, requires that there exist some single total order of all operations issued by all processes, such that: 1. every process's own operations appear in that order in the same sequence it issued them, and 2. every process observes operations happening in that same total order. Crucially, unlike linearizability, sequential consistency drops any requirement that this total order respect real, wall-clock time. **Linearizability additionally demands**: if operation A completes in real time before operation B begins, then A must appear before B in the order every observer sees. Sequential consistency has no such rule; it only requires internal consistency, one agreed order respecting each process's own sequence, not alignment with an external clock. ## What an implementation is allowed to do Mechanically, this distinction changes what an implementation is allowed to do. - **A linearizable system** must ensure that once a write is acknowledged complete, no subsequent read in real time from any process can return an older value, which typically forces real-time-respecting synchronization such as waiting for a quorum acknowledgment or routing operations through a leader with a fresh lease. - **A sequentially consistent system** is free to reorder or delay how it makes operations visible relative to real time, as long as it maintains one globally agreed story that respects each individual process's own local ordering — for instance it could batch and reorder writes for efficiency, or use loosely synchronized clocks, as long as the final total order it presents to every observer is internally coherent. ## Why a designer reaches for it, and why the promise disappoints The reason a designer might reach for sequential consistency is the theoretical promise that dropping the real-time constraint should be cheaper than linearizability, since fewer synchronization mechanisms are strictly required. In practice this promise is often disappointing: sequential consistency still requires every replica to agree on a single global order for all operations, including operations from processes that have never communicated, and achieving that kind of global agreement across geo-distributed replicas typically still requires a consensus protocol, a global sequencer, or a single serializing leader — close to the same coordination cost linearizability pays. ## The anomaly it permits The concrete anomaly sequential consistency permits, that linearizability forbids, is this: 1. process `P1` finishes write `W` in real time at `T1`; 2. process `P2`, whose read starts at `T2` strictly after `T1`, is still allowed to see the value from before `W`, as long as the overall order the system settles on remains internally coherent. Sequential consistency only promised a coherent story, not a promise that if it's over, it's visible. ## The trade-off The trade-off, then, is subtle and worth stating precisely: sequential consistency buys a weaker guarantee, no real-time ordering, without necessarily buying a proportionally cheaper implementation, because the expensive part, global agreement across all replicas, is largely unavoidable either way. This is why sequential consistency is comparatively rare as an explicit target for distributed databases: designers who want real coordination savings usually go further down the spectrum to causal consistency, which drops the requirement to order unrelated operations at all, genuinely removing coordination for the common case, or all the way to eventual consistency, rather than stopping at sequential, which keeps most of the cost while giving up the most intuitive guarantee. ## Where it fits, and where it does not - **The classic anti-pattern.** In production, a team that migrates from a linearizable configuration to a sequentially consistent one expecting a big latency win is a classic anti-pattern: the measured improvement is often small, because the system still needs a way to agree globally on one order, and that mechanism, a sequencer, a leader, or a consensus round, dominates the latency budget regardless of the real-time relaxation. - **Where it genuinely shines.** Where sequential consistency genuinely shines is in a different setting: multiprocessor and multi-core CPU memory models and certain in-memory concurrent data structures, where a single machine can cheaply establish and broadcast one global instruction order to its cores without the cross-datacenter network latency that makes the distributed-database case expensive. It is a model born out of hardware memory ordering, and its most successful uses remain much closer to that origin than to globally-replicated cloud databases.

  • Since sequential consistency still requires a single global total order agreed on by everyone, why is it not much cheaper to implement than linearizability?
    Agreeing on any single global order across all replicas typically still requires consensus-like coordination, such as a sequencer or agreement protocol, to serialize all operations. The only thing dropped is the real-time constraint, which removes some clock-synchronization requirements but not the core cost of global agreement, so distributed databases rarely target pure sequential consistency in practice.
  • Where does sequential consistency actually get used in practice?
    It originated in, and is more commonly seen in, multiprocessor and CPU memory models and some in-memory concurrent data structures, where a single machine can cheaply establish a global instruction order without cross-datacenter latency. It is much less common as the target model for distributed databases.
  • How would you explain to a team why picking sequential consistency for a globally-replicated database might not deliver the cost savings they expect?
    Achieving agreement on a single global order across geographically distributed replicas requires essentially the same cross-region coordination, a leader, consensus, or global sequencer, that linearizability needs. Teams should compare it against linearizability's actual latency numbers rather than assuming a weaker guarantee automatically means cheaper; the bigger latency wins usually come from moving to causal or eventual models instead.

Like a group of editors agreeing on a single, internally consistent chapter order for a book, even though that agreed order doesn't have to match the actual order the chapters were literally written in.

saying these in an interview costs you the question

  • assumes sequential consistency is always meaningfully cheaper than linearizability in a distributed system
  • can't state that sequential consistency drops the real-time constraint but keeps the total-order requirement
  • confuses sequential consistency with serializability, a transaction isolation term
  • can't name a real anomaly sequential consistency permits that linearizability forbids

context