Understanding Sequential, Causal, and Eventual Consistency Models
This article explains the concepts of sequential, causal, and eventual consistency models, illustrating their definitions, guarantees, and practical examples—including process interactions and real‑world scenarios—while comparing their strengths, trade‑offs, and related consistency guarantees such as monotonic reads, writes, and read‑your‑writes.
In earlier posts we briefly described several consistency models and their relevance to database transactions; this article expands the discussion to cover additional well‑known models—sequential, causal, and eventual consistency—commonly encountered in distributed systems.
Sequential Consistency
Lamport defines sequential consistency as a property where the result of any execution is as if the operations of all processes were executed in some sequential order that respects the program order of each individual process.
A more intuitive explanation is provided: imagine independent clients (e.g., CPUs or threads) accessing a shared resource (e.g., RAM or a distributed file system). Each client sees its own operations in program order, but the global order of operations across clients is not guaranteed.
When a system claims to be strictly serializable, it must present a single global order for all operations, often requiring a global clock. Sequential consistency relaxes this requirement: each process’s operations remain ordered, but the overall interleaving of operations from different processes can vary, allowing more flexibility and easier implementation without a global clock.
Causal Consistency
Causal consistency guarantees that only causally related operations are seen in the same order by all processes; unrelated operations may be observed in different orders on different clients.
Examples illustrate that writes that are causally related (e.g., a write followed by another write that depends on the first) must be seen in the same order by every process, while independent writes can be reordered.
A human‑friendly example using comments and replies shows how violating causal order can lead to confusing conversation histories.
Eventual Consistency
Eventual consistency promises that, in the absence of new writes, all clients will eventually see the same system state. It is a weak guarantee that is easy to implement and offers high performance.
The article also enumerates several related guarantees that together achieve eventual consistency: Monotonic Reads (MR), Monotonic Writes (MW), Read‑Your‑Writes (RYW), Pipelined Random Access Memory (PRAM), and Writes‑Follow‑Reads (WFR).
These guarantees describe how operations from a single client are observed by others, ensuring that reads and writes appear in a sensible order without requiring a strong global ordering.
Conclusion
The final discussion maps consistency guarantees to regions in a CAP‑style diagram, explaining why some areas correspond to high availability with weak guarantees, while others require stronger consistency. Further details can be found in Peter Bailis’s paper.
Architects Research Society
A daily treasure trove for architects, expanding your view and depth. We share enterprise, business, application, data, technology, and security architecture, discuss frameworks, planning, governance, standards, and implementation, and explore emerging styles such as microservices, event‑driven, micro‑frontend, big data, data warehousing, IoT, and AI architecture.
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.