Skip to content
StackDecode
System Design
5. Advanced Database ArchitectureAnimated

Causal Consistency

Related operations are seen in order.

The idea

If B depends on A, everyone sees A before B. Unrelated operations can appear in any order.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

ABC[1,0,0]

Process A a local event: increment its own counter. Timestamp [1,0,0].

event:
1
1/9

Vector clocks can tell whether two events are ordered or concurrent.

Step by step

  1. 1Track what an operation depends on
  2. 2Deliver after dependencies
  3. 3Unrelated ops proceed freely
  4. 4Result matches user intuition

Where it is used

Comments and replies.

Watch out for

Needs metadata such as vector clocks.

Related