Consistency model

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In computer science, consistency models are used in distributed systems like distributed shared memory systems or distributed data stores (such as a filesystems, databases, optimistic replication systems or Web caching). The system supports a given model if operations on memory follow specific rules. The data consistency model specifies a contract between programmer and system, wherein the system guarantees that if the programmer follows the rules, memory will be consistent and the results of memory operations will be predictable.

High level languages, such as C, C++, and Java, partially maintain the contract by translating memory operations into low-level operations in a way that preserves memory semantics. To hold to the contract, compilers may reorder some memory instructions, and library calls such as pthread_mutex_lock() encapsulate required synchronization.[1]

Verifying sequential consistency is undecidable in general, even for finite-state cache-coherence protocols.[2]

Consistency models define rules for the apparent order and visibility of updates, and it is a continuum with tradeoffs.[3]


Assume that the following case occurs:[3]

  • The row X is replicated on nodes M and N
  • The client A writes row X to node N
  • After a period of time t, client B reads row X from node M

The consistency model has to determine whether client B sees the write from client A or not.


A non-exhaustive list of consistency models are

See also[edit]


  1. ^ Mark D. Hill (August 1998). "Multiprocessors Should Support Simple Memory Consistency Models". IEEE Computer 31 (8): pp.28–34. doi:10.1109/2.707614. 
  2. ^ Shaz Qadeer (August 2003). "Verifying Sequential Consistency on Shared-Memory Multiprocessors by Model Checking". IEEE Transactions on Parallel and Distributed Systems 14 (8): pp.730–741. doi:10.1109/TPDS.2003.1225053. 
  3. ^ a b Todd Lipcon (2014-10-25). "Design Patterns for Distributed Non-Relational Databases". Retrieved 2011-03-24. "A consistency model determines rules for visibility and apparent order of updates. Example: * Row X is replicated on nodes M and N * Client A writes row X to node N * Some period of time t elapses. * Client B reads row X from node M * Does client B see the write from client A? Consistency is a continuum with tradeoffs" 
  4. ^ Lloyd, Wyatt. "Don’t Settle for Eventual:Scalable Causal Consistency for Wide-Area Storage with COPS". Proceedings of the 23rd ACM Symposium on Operating Systems Principles (SOSP’11). 

Further reading[edit]

External links[edit]