Definition
Read-your-writes guarantees ensure users can observe their own successful updates, even when storage replicas are eventually consistent.
Key Concepts
- Session affinity can pin reads to fresh replicas.
- Version tokens encode minimum acceptable freshness.
- Selective quorum reads can tighten guarantees.
- Guarantees should be endpoint-specific, not global.
How It Works
After write acknowledgment, clients carry a session token or version watermark; subsequent reads route to replicas that satisfy that minimum version.
Comparison Table
| Pattern | Benefit | Cost |
|---|---|---|
| Session stickiness | Simple RYW | Hot-spot risk |
| Version token | Precise freshness | Token plumbing |
| Quorum read fallback | Higher confidence | Higher latency |
Production Implications
Teams on Dynamo-style stores and Cassandra often implement read-your-writes at API layers to avoid over-constraining the whole data plane. This reduces UX confusion without imposing global linearizability.
When to Use / Not Use
Use It When
- Profile updates, checkout state, workflow confirmations.
- Any UX where immediate reflection of writes is expected.
Avoid It When
- Highly cacheable anonymous content where token handling is expensive.
- Domains needing full serializable transactions.
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.