Definition
Causal consistency guarantees that operations with a cause-and-effect relationship are observed in order, while unrelated operations may be seen in different orders.
Key Concepts
- Maintains happens-before ordering for dependent events.
- Stronger than eventual consistency, weaker than linearizability.
- Prevents anomalies like seeing a reply before its message.
- Common in messaging, collaboration, and activity streams.
How It Works
Systems track causal metadata (such as vector clocks or dependency sets) and delay visibility of writes until dependencies are satisfied.
Comparison Table
| Model | Ordering guarantee | Typical workload |
|---|---|---|
| Linearizable | Single global real-time order | Transactions |
| Causal | Dependency order only | Messaging/collaboration |
| Eventual | Convergence only | Feeds/caches |
Production Implications
Causal consistency improves UX coherence in chat and collaborative apps without forcing every operation through global coordination. Dynamo-derived designs and Cassandra-adjacent architectures often combine causal metadata with async replication for balanced performance.
When to Use / Not Use
Use It When
- Messaging threads and social comment trees.
- Collaborative editing and notification pipelines.
Avoid It When
- Strict financial settlement where total order is mandatory.
- Global counters that require exact instantaneous values.
Key Takeaways
- Start with user-visible correctness requirements, then choose the weakest model that still preserves them.
- Instrument staleness and conflict rates; treat them as first-class production metrics.
- Design reconciliation and repair workflows before incidents force ad-hoc fixes.