Demystifying Consistency Models: From Linear to Eventual in Distributed Systems
This article explores the concept of consistency in distributed systems, breaking down various consistency models—including linear, sequential, causal, and eventual—explaining their definitions, practical implications, and how they guide the design of high‑availability architectures and data replication strategies.
What Is a Consistency Model?
In the study of fault‑tolerant distributed systems, consistency refers to the guarantees about the state of objects—such as nodes, services, or data—across replicas. A consistency model is a conceptual tool that describes how those states evolve over time, helping engineers reason about system behavior.
Why Consistency Models Matter
When designing high‑availability architectures, stakeholders often challenge the system’s state presentation. A consistency model provides a language to explain, analyze, and validate whether the observed state meets expectations, especially when multiple teams or leaders question the system’s behavior.
Decomposing the Term
"Consistency" describes an object’s state; "model" is the abstraction that captures how that state changes under external pressure over time. Different perspectives lead to different models: database developers focus on single‑value operation consistency, while application developers consider single‑client (session) consistency. Both stem from the replication of multiple copies.
Categories of Consistency Models
We can group consistency models into three major families, using a single‑object viewpoint and thread‑level granularity:
Linear consistency
Sequential and causal consistency
Eventual consistency
Linear Consistency Model
Linear consistency (often called atomic consistency) ensures that the system behaves as if there is only one replica. Writes become visible to all subsequent reads after they complete, enforcing a strict temporal order.
Example timeline:
In this diagram, a write of x = 1 at time t1 becomes visible only after t2. Before t2, reads return the initial value x = 0. This guarantees that once a new value is written, all later reads see that value until it is overwritten.
Linear consistency requires atomic writes and a global ordering of operations.
Sequential and Causal Consistency
Sequential consistency imposes a total order on operations, similar to linear consistency, but without requiring a global clock. Causal consistency relaxes this by only ordering operations that have a causal relationship; concurrent operations may be incomparable.
Illustration of causal ordering:
In a restaurant ordering system, each client sees its own sequence of added items, but different clients cannot compare the order of their operations, demonstrating partial (causal) ordering.
Causal consistency defines a partial order: operations with a causal link are comparable, while concurrent operations are not.
Eventual Consistency
Eventual consistency tolerates temporary divergence among replicas. After a stabilization point (e.g., timeline t4), all replicas converge to the same state. This model accepts short‑lived inconsistencies, unlike linear or causal models which aim for immediate agreement.
Summary
The three primary consistency models—linear (atomic), causal (partial order), and eventual—provide a spectrum of guarantees that help engineers design replication strategies, resolve conflicts, and meet the reliability requirements of distributed applications.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Xiaokun's Architecture Exploration Notes
10 years of backend architecture design | AI engineering infrastructure, storage architecture design, and performance optimization | Former senior developer at NetEase, Douyu, Inke, etc.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
