Study smarter with Fiveable
Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.
Consistency models define the rules for how distributed systems maintain reliable data across multiple nodes, processes, and geographic regions. They govern the tradeoffs between data accuracy, system availability, and performance. These models show up constantly in questions about distributed databases, cloud computing architectures, and concurrent programming.
Don't just memorize definitions. Know what problem each model solves and what tradeoffs it accepts. You'll be asked to recommend consistency models for specific scenarios, compare the ordering guarantees of different models, or explain why a system like DNS uses eventual consistency while a banking system requires something stronger. Master the why behind each model, and the scenario questions become straightforward.
These models provide the strictest guarantees about how operations appear across the system. They sacrifice performance for correctness, requiring coordination mechanisms that introduce latency but ensure all processes see the same global state.
Note that linearizability is sometimes treated as the formal definition of strong consistency. The distinction matters: "strong consistency" is often used informally to mean "reads always see the latest write," while linearizability is a precisely defined property with real-time constraints. In practice, many systems that claim "strong consistency" are actually providing linearizability.
Compare: Linearizability vs. Sequential Consistency: both guarantee a global ordering, but linearizability requires operations to respect real-time ordering while sequential consistency only requires a consistent sequence that preserves each process's program order. If a question asks about the "strongest consistency guarantee," linearizability is your answer.
These models relax the requirement that all processes see the same global order. They permit different views across processes while maintaining specific guarantees, enabling better performance in distributed environments.
Compare: Causal Consistency vs. PRAM: both allow different processes to see different orderings of writes, but causal consistency tracks logical dependencies across processes while PRAM only guarantees ordering within a single process's writes. For example, if process P1 writes X, then process P2 reads X and writes Y, causal consistency requires all observers to see X before Y (because Y causally depends on X). PRAM makes no such guarantee since X and Y came from different processes. Causal is strictly stronger than PRAM.
These models focus on what an individual client or session experiences rather than global system state. They're designed for user-facing applications where perceived consistency matters more than absolute global ordering. Systems often layer these guarantees on top of a weaker base model like eventual consistency.
Compare: Monotonic Read vs. Monotonic Write: both provide "monotonic" guarantees but in opposite directions. Monotonic read ensures you never see older data after seeing newer data; monotonic write ensures your writes are applied in order. A shopping cart system likely needs both: you need your "add item" writes applied in order (monotonic write), and you need to never see your cart revert to a previous state (monotonic read).
When system availability and partition tolerance matter more than immediate consistency, these models accept temporary inconsistencies in exchange for better performance and fault tolerance.
Compare: Strong Consistency vs. Eventual Consistency: these represent opposite ends of the consistency spectrum. Strong consistency guarantees immediate visibility but requires coordination; eventual consistency maximizes availability but accepts temporary divergence. The CAP theorem tells us that during a network partition, a distributed system must choose between consistency (C) and availability (A). Strong consistency chooses C; eventual consistency chooses A.
| Concept | Best Examples |
|---|---|
| Strictest global ordering | Linearizability, Strong Consistency |
| Global order without real-time | Sequential Consistency |
| Partial ordering by causality | Causal Consistency, PRAM |
| Per-client guarantees | Read-Your-Writes, Session Consistency |
| Monotonic progress | Monotonic Read, Monotonic Write |
| Maximum availability | Eventual Consistency |
| Banking/financial systems | Linearizability, Strong Consistency |
| Social media/DNS | Eventual Consistency |
Which two consistency models both guarantee a global ordering of operations, and what distinguishes them from each other?
A user posts a comment on a social media platform but doesn't see it appear when they refresh. Which client-centric consistency guarantee has been violated?
Compare and contrast Causal Consistency and PRAM Consistency. Under what circumstances would PRAM allow different orderings that Causal Consistency would not?
You're designing a distributed banking system that processes transfers between accounts. Which consistency model would you recommend, and why would eventual consistency be inappropriate?
Explain how Monotonic Read Consistency and Monotonic Write Consistency could both be satisfied in a system that doesn't provide Sequential Consistency. What global guarantee would still be missing?