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

Eventual Consistency

Graduate Depth 98 in the knowledge graph ☐ I know this ☆ Set as goal
6topics build on this
364prerequisites beneath it
See this on the map →
Consistency Models in Distributed Systems→→CRDTs: Conflict-Free Replicated Data TypesGossip Protocols and Epidemic Algorithms+2 more
eventual-consistency weak-consistency availability

Core Idea

Eventual consistency guarantees that if no new writes occur, all replicas will converge to the same state. Writes succeed on any replica without waiting for others, providing high availability and partition tolerance. Applications must tolerate temporary divergence and resolve concurrent writes (conflict resolution), used widely in systems like Dynamo and Cassandra.

Explainer

From your study of consistency models, you know the spectrum ranges from strong consistency (every read sees the most recent write) to weaker guarantees that trade correctness for performance. Eventual consistency sits near the weak end of that spectrum, making a deliberately modest promise: if writes stop, all replicas will *eventually* converge to the same state. It does not say how long convergence takes, and it explicitly allows different replicas to return different values for the same key at the same moment. This sounds alarming, but it is the foundation of many of the most available and scalable systems in production.

The motivation is practical. Strong consistency requires coordination — typically waiting for a majority of replicas to acknowledge a write before considering it committed. That coordination takes time and, critically, fails during network partitions: if a node cannot reach a quorum, it must reject the write. Eventual consistency avoids this by letting any replica accept a write immediately and propagate it to others asynchronously. During a network partition, both sides continue serving reads and writes independently. When the partition heals, replicas exchange their updates and converge. The result is a system that is always available and tolerates partitions — the "AP" choice in the CAP theorem you encountered when studying consistency models.

The hard problem is conflict resolution: what happens when two replicas independently accept conflicting writes to the same key during a partition? There are several strategies. Last-writer-wins uses timestamps to pick the most recent write, which is simple but discards data and depends on synchronized clocks. Vector clocks track causal ordering so the system can detect true conflicts (concurrent writes with no causal relationship) and present them to the application or user for resolution. CRDTs (conflict-free replicated data types) design data structures so that all possible merge orders produce the same result, eliminating conflicts by construction. Each strategy trades off simplicity, data preservation, and application complexity.

In practice, eventual consistency works well for use cases where temporary staleness is acceptable: social media feeds, shopping cart contents, DNS, and content delivery networks. A user might see a slightly outdated view of their friend's posts for a few seconds — an acceptable tradeoff for the system remaining available worldwide even during infrastructure failures. The key skill is recognizing which parts of your application can tolerate this divergence and which require stronger guarantees. Most real systems are not purely one or the other — they use eventual consistency for high-throughput paths and stronger consistency selectively where correctness demands it.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Kernel Architecture and OS Structure → System Calls and User/Kernel Mode → Processes and the Process Control Block → Logical Clocks and Event Ordering → Vector Clocks and Capturing Causality → Happened-Before Relation and Causal Ordering → Consistency Models in Distributed Systems → Eventual Consistency

Longest path: 99 steps · 364 total prerequisite topics

Prerequisites (1)

Leads To (4)