liveBook · Manning

Consistency

As explained in Latency

A consistency guarantee is a specified condition governing the visibility and ordering of data updates across replicated copies.

Consistency is a guarantee governing when updates become visible and how operations are ordered across replicated copies. Replication improves availability and latency, but keeping copies synchronized creates a trade-off among consistency, availability, and latency. section 4.0 section 4.3

A consistency model specifies whether a write is immediately visible across copies and, if not, when readers can expect visibility. Strong consistency, also called linearizability, gives the illusion of one copy: each operation observes the latest state, at the cost of coordination and latency. section 4.3.1 section 4.3

Figure 4.1 An example of a linearizable key–value store with three replicas. Each of the replicas is in the same state after every operation because linearizability gives the illusion of a single copy of data being accessed and updated.
Figure 4.1: An example of a linearizable key-value store with three replicas. Each of the replica is in the same identical state after every operation because linearizability gives the illusion of a single copy of data being accessed and updated.

A three-replica key–value store shows linearizable operations updating every replica to the same state after each write. section 4.3.1

Choose consistency guarantees according to correctness and latency requirements:

  • Use stronger guarantees when applications require the latest shared state; accept additional coordination and latency. section 4.0 section 4.3
  • Distinguish linearizability from serializability: linearizability orders operations on a single object, while serializability governs multiple operations across objects. section 4.3.1
  • Do not confuse distributed consistency with ACID consistency: distributed consistency concerns data visibility, while ACID consistency preserves database invariants. section 9.4
  • Treat optimistic updates and predictive techniques as latency improvements that may require conflict resolution and tolerance for temporary inconsistency. section 11.6

How Latency covers it

How deep it goes
Defines consistency models, explains linearizability and its latency cost, and distinguishes it from serializability and ACID consistency.
Examples
Uses CDNs, a three-replica key–value store, ACID isolation levels, and optimistic updates to illustrate consistency choices.
What it assumes
Builds from replicated data copies and distinguishes distributed consistency from transactional database consistency.
What you can do after
Evaluate consistency choices against application needs for freshness, availability, correctness, and latency.
How it connects
Connects consistency to replication, availability, latency, linearizability, serializability, transactions, isolation, and conflict resolution.

Also explained in

Compare how 20 books explain consistency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Latency. The section links point to the parts of the book it draws on.