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.
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
- 1Track what an operation depends on
- 2Deliver after dependencies
- 3Unrelated ops proceed freely
- 4Result matches user intuition
Where it is used
Comments and replies.
Watch out for
Needs metadata such as vector clocks.