Causally Consistent Distributed Storage

Causal storage ensures that seeing an update also entails visibility of its dependencies. Version vectors summarize which prefix of each replica’s history is known.

Source
Anbloq
Language
English
Created
Updated
Chapters
3
Reading time
2 min
In this article3 chapters
  1. Causality relates client actions and messages
  2. A version vector tests a visibility condition
  3. Causality, conflict handling and availability

Causality relates client actions and messages

If a client reads one update and then writes another, the first can be a dependency of the second. Local program order and read-from edges generate a causal relation by transitivity. A causally consistent reader can see the new write only with a view containing the required earlier writes. Two independent writers can issue concurrent updates whose relative order is not determined by causality. A storage system still needs a rule for representing or resolving their values.

A vector clock can distinguish ordered updates from incomparable ones. The causal delivery rule then chooses which prerequisites a replica must expose before making a dependent record visible.

A version vector tests a visibility condition

Assume each component records a contiguous prefix of one writer’s updates. If an incoming update requires dependency vector \(D\) and the replica has applied prefix vector \(V\), a sufficient visibility condition is

\[ D\le V \quad\Longleftrightarrow\quad \forall i,\ D_i\le V_i . \]

For example, a note referring to an uploaded attachment must not be visible at a replica that has the note but lacks the attachment version it references. Delaying visibility until the attachment arrives preserves the causal relation. A counter with gaps would not justify the same comparison, which is why prefix semantics matters.

Causality, conflict handling and availability

A dependency check may delay reads at one replica even while a writer returns locally. Protocols such as COPS separate data transfer from the check that dependent versions exist. Garbage collection must respect clients and replicas that may still refer to older versions. If a replica partition prevents access to dependencies, the service’s session guarantee determines what can be returned. See version and hybrid clocks, convergence of replicated data types, and the stronger real-time condition in linearizability testing.[1][2]

References

  1. Wyatt Lloyd et al., Don’t Settle for Eventual: Scalable Causal Consistency for Wide-Area Storage with COPS ↩
  2. Leslie Lamport, Time, Clocks, and the Ordering of Events in a Distributed System ↩