Writes-Follow-Reads Consistency
What You'll Learn
You'll understand how writes-follow-reads consistency guarantees that any write operation you perform will be ordered after any reads that causally influenced it.
The Core Idea
Writes-follow-reads consistency ensures that if you read a value and then perform a write based on that read, the system guarantees your write will appear after that read in the global ordering. This prevents paradoxical situations where your write seems to "travel back in time" and appear before the data you read to make your decision.
Think of it like a conversation: if Alice tells you "The meeting is at 3 PM" (you read), and you then announce "I'll bring snacks to the 3 PM meeting" (you write), your announcement should never appear to others as happening before Alice's original message. That would be confusing and break causality!
Why It Matters
In distributed systems, operations from different nodes can be reordered in strange ways. Without writes-follow-reads consistency, you might:
- Read version 5 of a document
- Write a comment: "Great changes in v5!"
- Have other users see your v5 comment but only v4 of the document
This creates a causality violation—your write appears to reference something that "doesn't exist yet" from another user's perspective.
The Guarantee
With writes-follow-reads consistency, the system ensures:
- Your write operation is timestamped or ordered to occur after any read that causally preceded it
- Other nodes will observe that ordering relationship
- Causality chains are preserved across the distributed system
Key Takeaway: Writes-follow-reads consistency prevents causality violations by guaranteeing that writes always appear after the reads that influenced them in the observable order of operations.