softwarearchitecture systemdesign/concepts

Introduction

Consistency has different meanings in ACID and CAP.

ACID consistency focuses on data relationship like foreign keys and uniqueness.
👉 ACID Principles > Consistency

CAP consistency is actually linearizability, defined as all nodes containing the same data at a moment in time, and changes in data must be linear; that is, nodes must start serving the changes at the same time.

MongoDB, HBase, and Redis trade off availability for linearizability, while CouchDB, Cassandra, Dynamo, Hadoop, and Riak trade off linearizability for availability.

Database Internals, Chapter 11

🌟 Linearizability & Eventual Consistency

  • Full Mesh Communication: All nodes directly communicate to sync state.
  • Quorum Reads/Writes: Majority voting ensures consistent decisions.

Strong Consistency

In strong consistency, all accesses are seen by all parallel processes (or nodes, processors, etc.) in the same order (sequentially). Therefore, only one consistent state can be observed, as opposed to weak consistency, where different parallel processes (or nodes, etc.) can perceive variables in different states.


Consistency Patterns - System Design