Consistency Vs Coherence
Consistency is the agreement between multiple nodes in a distributed system to achieve a certain value. Specifically, it can be divided into strong consistency and weak consistency. [1]
Strong consistency: The data in all nodes is the same at any time. At the same time, you should get the value of key1 in node A and the value of key1 in node B. [1]
Weak consistency: There is no guarantee that all nodes have the same data at any time, and there are many different implementations. The most widely achieved is the ultimate consistency. [1]
One type of data occurring simultaneously in different cache memory is called cache coherence, or in some systems, global memory. Cache coherence is the uniformity of shared resource data that ends up stored in multiple local caches. [2]
Memory coherence: a memory system is coherent if any read of a data item returns the most recently written value of that data item (what values can be returned by a read). [3]
Memory consistency: A memory consistency model for a shared address space specifies constraints on the order in which memory operations must appear to be performed (i.e. to become visible to the processors) with respect to one another. [3]
In simpler terms the difference between Consistency and coherence lies in, Coherence defines the behavior of reads and writes to the same memory location, while consistency defines the behavior of reads and writes with respect to accesses to other locations. [3]
References
[1] Ayoub, M. (2018, September 06). Understanding of consistency in distributed systems. Retrieved June 8, 2021, from https://medium.com/@mena.meseha/understanding-of-consistency-in-distributed-systems-27da174cc05a
[2] Cache coherence. (2021, April 27). Retrieved June 8, 2021, from https://en.wikipedia.org/wiki/Cache_coherence
[3] Jia, W. (2020, January 06). What’s the difference between memory coherence and consistency? Retrieved June 8, 2021, from https://www.systutorials.com/whats-the-difference-between-memory-coherence-and-consistency/
[4] Sarode, J. D. (n.d.). Cache coherence vs Consistency. Jayprogramming — Google Sites. Retrieved June 9, 2021, from https://sites.google.com/site/jdsarodeprogramming/computer-architecture/cache-coherence-vs-consistency
[5] Koopman, P. (1998). MultiprocessorConsistency andCoherence [Slides]. Carnegie Mellon University. https://users.ece.cmu.edu/~koopman/ece548/handouts/19coher.pdf