A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Consistency Models in Distributed Systems

Graduate Depth 97 in the knowledge graph I know this Set as goal
23topics build on this
363prerequisites beneath it
See this on the map →
Introduction to Distributed SystemsHappened-Before Relation and Causal OrderingCache Coherence Protocols and Memory ConsistencyCausal Consistency+6 more
consistency correctness models

Core Idea

Consistency models define what values a read can return after a write in a replicated system. Strong models (linearizability, sequential consistency) provide intuitive semantics but require coordination overhead. Weaker models (eventual consistency, causal consistency) improve availability and latency by tolerating temporary disagreement and concurrent write conflicts.

Explainer

From your study of distributed systems, you know that replication — storing the same data on multiple nodes — is fundamental to fault tolerance and scalability. But replication introduces a problem: what happens when a client writes to one replica and reads from another? What value should the read return? Consistency models are the formal answer to this question. They define the contract between the system and its clients about which behaviors are observable.

The strongest commonly-used model is linearizability (sometimes called atomic consistency). It requires that every operation appear to execute instantaneously at a single point in time, and that this point respects real-world clock order. If a write completes before a read begins, the read must see the new value. This is the intuition most programmers have about a variable — you write 5, then you read 5. Achieving linearizability across replicas requires coordination: the system must ensure that before a read returns, it has contacted enough replicas to guarantee it has the latest value (typically a quorum).

Sequential consistency is slightly weaker. It requires that all clients observe operations in the same global order, but that order does not need to match wall-clock time. Client A's write might appear to happen "before" client B's write in the global sequence even if B's write completed earlier in real time. This relaxation removes the real-time constraint and can allow more efficient implementations, but the semantics are harder to reason about.

Eventual consistency is much weaker and much more practical for geographically distributed systems. It guarantees only that, if no new writes occur, all replicas will eventually converge to the same value. There is no bound on *when* — a read may see a stale value for seconds or minutes. This allows replicas to accept writes locally and synchronize asynchronously, yielding very low write latency. Systems like DNS and shopping cart databases often use eventual consistency.

Between these extremes, causal consistency offers a useful middle ground: if operation A causally precedes operation B (e.g., you read a message, then reply to it), then any client that sees B must also have seen A. This preserves the logical flow of causally related events without requiring global coordination. The choice of consistency model is ultimately an engineering tradeoff between correctness guarantees, latency, and availability — and it must match the actual requirements of the application.

Practice Questions 3 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication 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 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesBoolean AlgebraBoolean Type and Truth ValuesComparison Operators and Boolean TestsLogical Operators and Boolean AlgebraBoolean Algebra and Fundamental LawsLogic Gates FundamentalsImplementing Boolean Functions with GatesKarnaugh Map SimplificationCombinational 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 Systems

Longest path: 98 steps · 363 total prerequisite topics

Prerequisites (2)

Leads To (8)