Linearizability

Research Depth 69 in the knowledge graph I know this Set as goal
Unlocks 5 downstream topics
consistency formal-semantics correctness

Core Idea

Linearizability is the strongest consistency model: all operations appear to execute atomically at some point between their invocation and completion, and the execution respects a total order. A linearizable system behaves as if there is a single copy of the data. This model prevents stale reads, causality violations, and ensures a consistent view of shared state across all clients.

How It's Best Learned

Compare linearizable and non-linearizable execution histories side by side. Understand why linearizability is stricter than sequential consistency and more expensive to implement. Implement a simple linearizable register and test with concurrent operations from multiple clients.

Common Misconceptions

Explainer

From your study of consistency models, you know that distributed systems must choose how much ordering and freshness to guarantee when multiple nodes hold copies of the same data. Linearizability sits at the top of that hierarchy — it is the strongest single-object consistency model, and it makes a distributed system behave as though there is only one copy of the data, accessed by one operation at a time.

The core guarantee is this: every operation appears to take effect atomically at some single point in time between when the client issued the request and when the client received the response. This point is called the linearization point. If client A's write completes before client B's read begins (in real, wall-clock time), then B is guaranteed to see A's write. There is no window where stale data can leak through. Imagine a shared whiteboard in a room — anyone who walks in sees whatever was most recently written. Linearizability gives you that same property even when the "whiteboard" is replicated across machines in different data centers.

Compare this with sequential consistency, which also produces a total order of operations but does not require that order to match real time. Sequential consistency says "there exists some legal ordering," while linearizability says "that ordering must respect the actual wall-clock sequence of non-overlapping operations." The distinction matters when two clients coordinate out of band — for example, if Alice writes a value and then calls Bob on the phone to say "go read it," linearizability guarantees Bob sees the write. Sequential consistency does not.

The cost of linearizability is significant. The CAP theorem tells us that a linearizable system cannot remain both consistent and available during a network partition — it must sacrifice availability by refusing to serve requests from the minority partition. In practice, achieving linearizability requires coordination protocols like consensus (Paxos, Raft) or careful use of a single leader, both of which add latency. This is why many real-world systems offer weaker consistency by default and reserve linearizability for operations that truly need it — like acquiring a distributed lock or performing a compare-and-swap on a configuration value.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsOperators and ExpressionsArithmetic Operators and Operator PrecedenceComparison Operators and Boolean TestsLogical Operators and Boolean AlgebraBoolean Algebra and Fundamental LawsCombinational Circuit DesignFlip-Flops and LatchesBinary Counters: Design and AnalysisBinary ArithmeticFixed-Point Number RepresentationTwo's Complement RepresentationOverflow and Underflow DetectionBinary Adders: Half-Adders and Full-AddersFull Adder and Carry PropagationCarry Lookahead Adder DesignHalf Adder Circuit DesignMultiplication Circuit DesignSequential Circuit DesignRegisters and Register FilesInstruction Set Architecture (ISA)Kernel Architecture and OS StructureSystem Calls and User/Kernel ModeProcesses and the Process Control BlockLogical Clocks and Event OrderingVector Clocks and Capturing CausalityHappened-Before Relation and Causal OrderingConsistency Models in Distributed SystemsRead-After-Write ConsistencySequential ConsistencyLinearizability

Longest path: 70 steps · 254 total prerequisite topics

Prerequisites (2)

Leads To (1)