Core Idea

In distributed systems, consistency (in the CAP sense) means every read returns the most recent write or a more recent one—the system behaves as if there is a single copy of the data.

Definition

Consistency in the context of the CAP-Theorem denotes that any read operation that begins after a write operation completes must return that value or a more recent write. All nodes see the same data at the same time. This is equivalent to linearizability: a strong correctness condition where the system behaves as if there is only a single copy of the data, and each operation appears to take effect instantaneously at some point between its invocation and response. It is distinct from ACID consistency (C in ACID), which refers to transactions leaving the database in a valid state according to rules and constraints—not to the visibility of the latest write across replicas.

Key Characteristics

  • Single-copy illusion: The system appears to have one logical copy of the data; reads always observe the most recent completed write.
  • Linearizability: Formal model where every operation has a linearization point; concurrent operations can be ordered as if they occurred sequentially.
  • Trade-off with availability: Under the CAP theorem, during a network partition a system cannot provide both consistency and Availability—it must choose. CP systems sacrifice availability to preserve consistency; AP systems sacrifice consistency for availability and use Eventual-Consistency.
  • Tunable in practice: Many distributed databases offer configurable consistency levels (e.g., quorum reads/writes) to trade latency and availability for stronger consistency when needed.
  • Scope: Can apply to a single object (per-object consistency) or to multiple objects (multi-object consistency, involving Distributed-Transactions).

Examples

  • Banking balance: A withdrawal must not complete unless all replicas agree on the new balance; reads must never show a stale balance after a committed write.
  • Ticket inventory: Selling the last seat must be visible to all nodes immediately to prevent overselling—strong consistency is required at checkout.
  • Configuration store: A feature-flag change should propagate so that all nodes applying the flag see the same value before the change is considered “done.”

Why It Matters

Consistency is a core design axis in distributed systems. Choosing strong consistency simplifies application logic (no stale reads) but increases latency and reduces availability during partitions. Weaker models like Eventual-Consistency enable higher Availability and Scalability but require applications to handle temporary divergence. The CAP-Theorem forces architects to make this trade-off explicit; Bounded-Context and Architecture-Quantum boundaries often align with consistency requirements. Fault-Tolerance and replication strategies (e.g., Replicated-Caching-Pattern) directly affect which consistency level is achievable.

Sources

  • Gilbert, Seth and Nancy Lynch (2002). “Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services.” ACM SIGACT News, Vol. 33, Issue 2, pp. 51-59.

  • Brewer, Eric A. (2000). “Towards Robust Distributed Systems.” Proceedings of the 19th ACM Symposium on Principles of Distributed Computing (PODC). Portland, Oregon.

  • Brewer, Eric A. (2012). “CAP Twelve Years Later: How the ‘Rules’ Have Changed.” Computer, Vol. 45, No. 2, pp. 23-29. IEEE Computer Society.

  • Herlihy, Maurice P. and Jeannette M. Wing (1990). “Linearizability: A Correctness Condition for Concurrent Objects.” ACM Transactions on Programming Languages and Systems, Vol. 12, No. 3, pp. 463-492.

    • Foundational definition of linearizability (equivalent to CAP-style strong consistency for registers)
    • DOI: 10.1145/78969.78972
  • Ford, Neal, Mark Richards, Pramod Sadalage, and Zhamak Dehghani (2022). Software Architecture: The Hard Parts - Modern Trade-Off Analyses for Distributed Architectures. O’Reilly Media. ISBN: 9781492086895.

Note

This content was drafted with assistance from AI tools for research, organization, and initial content generation. All final content has been reviewed, fact-checked, and edited by the author to ensure accuracy and alignment with the author’s intentions and perspective.