Session Guarantees
1. Executive Summary
Session guarantees are client-centric consistency properties that constrain what a single client session can observe when interacting with a weakly consistent or eventually consistent replicated store. Unlike global models such as linearizability or sequential consistency, session guarantees do not require all clients to agree on a single real-time order—they bound per-session anomalies such as reading stale data immediately after one's own write, seeing values "go backward in time," or losing causal dependencies within a workflow.
The canonical taxonomy—read-your-writes, monotonic reads, monotonic writes, and writes-follow-reads—was articulated by Terry et al. (1994) for weakly consistent replicated data. Causal consistency can be viewed as extending session guarantees across sessions linked by communication. Production systems implement session semantics via sticky routing (same replica per session), session tokens or version cookies passed with requests, gossiped client state, or synchronous local writes with asynchronous global replication.
This chapter defines each guarantee formally and informally, explains implementation mechanisms and failure modes, relates session guarantees to eventual and causal consistency, and provides principal-level interview framing. Session guarantees are how architects deliver acceptable user experience on AP systems without paying the full cost of linearizability on every read.
2. Why This Topic Matters
Eventually consistent systems dominate large-scale web, mobile, and multi-region deployments. Pure eventual consistency allows arbitrary temporary divergence—including anomalies that violate basic user expectations: posting a comment and not seeing it, refreshing a page and seeing an older balance, or shuffling UI state backward after navigation.
Principal architects must:
- Match guarantees to UX invariants — "Users must see their own edits" is read-your-writes, not global linearizability.
- Design client and gateway layers — Session tokens in cookies, gRPC metadata, or CDN keys are architecture, not afterthoughts.
- Debug "flaky" reports — Often session stickiness lost at load balancer after deploy.
- Negotiate with product — Session guarantees are cheaper than strong consistency but not free; stateful routing has failover implications.
Interview failures: treating read-your-writes as automatic on Cassandra/Dynamo without LOCAL_QUORUM and routing; unable to list four session guarantees; conflating session guarantees with serializability.
3. Problems Being Solved
| Problem | Pure eventual consistency | With session guarantees |
|---|---|---|
| Post-write read returns stale | Common on random replica | Read-your-writes prevents (within session) |
| Timeline "rewinds" on refresh | Possible | Monotonic reads prevent |
| Write reordering visible to author | Possible | Monotonic writes prevent |
| Read-dependent write based on stale read | Possible | Writes-follow-reads prevents |
| User distrust of AP system | High | Bounded anomalies improve UX |
| Cost of global linearizability | Prohibitive for all reads | Targeted per-session bounds |
Session guarantees solve "what can one client reasonably expect during replication lag?" They do not solve global agreement, cross-user real-time visibility, or multi-key atomicity without additional mechanisms.
4. Assumptions and System Model
Assume partial failure, asynchronous replication, and multiple replicas unless noted:
- Sessions: A client (or browser tab, mobile app instance) participates in a session identified explicitly or implicitly (connection, token, user id + device).
- Operations: Reads and writes on replicated objects; replication may lag arbitrarily before convergence.
- Eventual consistency baseline: If updates stop, replicas converge—session guarantees add intermediate constraints.
- No synchronized clocks required for basic session guarantees—implementation uses versions, tokens, or routing.
Not assumed: Global linearizability; transactional isolation across keys; automatic session guarantee without client/gateway cooperation.
Session boundary matters: Guarantees apply within a defined session. New session may observe stale state until convergence—document this for support teams.
5. Essential Terminology
| Term | Definition |
|---|---|
| Session | Sequence of operations by one client context bound by an identifier or sticky route. |
| Read-your-writes (RYW) | Session never reads a value older than one it has written. |
| Monotonic reads (MR) | If a session reads value v of object x, later reads of x in session return ≥ v (no going backward). |
| Monotonic writes (MW) | Writes by a session applied in program order at all replicas (no visible reordering of session writes). |
| Writes-follow-reads (WFR) | Write in session never visible before reads in same session that informed it (causal-ish within session). |
| Sticky session / sticky routing | Route session's requests to replica subset that has seen session writes. |
| Session token | Opaque version vector or timestamp client sends; server returns fresher than token. |
| Causal consistency | Preserves happens-before across all clients—stronger than combined session guarantees in general. |
| PRAM consistency | Parallel RAM—MW + RYW equivalent in some formulations. |
| Consistency window | Time/data versions during which anomaly could occur without guarantees. |
Mnemonic: Session guarantees = "my timeline makes sense to me"—not "everyone shares one timeline."
6. Core Mechanism
Terry et al. (1994) taxonomy
| Guarantee | Informal constraint |
|---|---|
| Read-your-writes | Own writes visible to own subsequent reads |
| Monotonic reads | Never read older value than previously observed in session |
| Monotonic writes | Session's writes appear in issue order everywhere |
| Writes-follow-reads | Causal order between reads and dependent writes in session |
Implication lattice (informal): WFR ⇒ RYW in many setups; MR + MW together relate to PRAM. Causal consistency ⇒ all four for causally linked ops across sessions.
Sticky routing implementation
Figure 1: Sticky routing sends session reads to a replica that has applied the session's writes—classic read-your-writes implementation.
Session token / version cookie
Figure 2: Gateway uses session token to reject or retry stale reads—works without strict stickiness if version metadata propagates.
Guarantee interaction diagram
Figure 3: Session guarantees form a partial order above eventual consistency; causal consistency extends across sessions.
7. Step-by-Step Walkthrough
Scenario: Social app, eventual consistent profile store, three replicas.
| Step | Action | Without guarantees | With RYW + MR |
|---|---|---|---|
| 1 | User updates avatar (write) | Ack from one replica | Write tracked in session state |
| 2 | User reloads profile (read) | Random replica may show old avatar | Read routed or token-checked → new avatar |
| 3 | Friend views profile | May see old avatar until replicate | Allowed—not session's read |
| 4 | User reloads again | Could theoretically see older if unlucky | MR blocks regression in session |
Walkthrough insight: Session guarantees are intentionally asymmetric—the author sees consistent session; viewers may lag. Product must accept or add stronger global guarantees for viewer paths.
Failure walkthrough — lost stickiness:
| Step | Action | Result |
|---|---|---|
| 1 | Deploy replaces load balancer; affinity cookie format changes | Stickiness lost |
| 2 | User writes bio | Replica B accepts |
| 3 | Next read hits Replica A | RYW violated—old bio shown |
Mitigation: Session tokens in API body, not only cookies; version check on every read path.
8. Invariants and Guarantees
| Guarantee | Type | Statement (within session S) |
|---|---|---|
| Read-your-writes | Safety | If S completes write w on x, subsequent read of x in S does not return state before w |
| Monotonic reads | Safety | Reads of x in S return non-decreasing versions |
| Monotonic writes | Safety | Writes by S appear in issue order at all replicas |
| Writes-follow-reads | Safety | If read r precedes write w in S, w not visible before r's value to any client |
| Cross-session freshness | Not guaranteed | Other sessions may observe stale state |
| Availability | Liveness | Not implied by session guarantees alone |
Safety vs liveness: Session guarantees are safety properties on observable histories per session. Liveness (eventual convergence) comes from eventual consistency baseline.
9. Failure Scenarios
Scenario 1: Load balancer affinity loss
Setup: Sticky sessions only via cookie; blue/green deploy drops affinity table.
Effect: RYW violations; user reports "my save didn't work."
Mitigation: Token in application layer; dual-write affinity during migration; synthetic canaries post-deploy.
Scenario 2: Multi-region without session state
Setup: User writes in us-east, reads via eu-west CDN without token forwarding.
Effect: Session guarantees broken across regions.
Mitigation: Global session store for tokens; geo-DNS with user home region; accept cross-region staleness explicitly.
Scenario 3: Mobile offline queue
Setup: Writes queued locally; reads from server without merging local queue.
Effect: RYW violated—server read ignores pending local write.
Mitigation: Read path merges local + remote; CRDT or explicit pending-write overlay.
Scenario 4: Microservices break session scope
Setup: API gateway provides RYW on profile service; feed service reads different replica set without token.
Effect: End-to-end UX violates user expectation though one service is "correct."
Mitigation: Propagate session context (W3C trace + version headers) across services.
Scenario 5: Clock-based session tokens
Setup: Token = wall-clock timestamp; skew causes false stale or acceptance of old data.
Effect: MR or RYW violations under clock drift.
Mitigation: Logical versions, vector clocks, or hybrid logical clocks—not raw NTP for correctness.
10. Performance Characteristics
| Mechanism | Latency impact | Throughput impact |
|---|---|---|
| Sticky routing | Low if replica local | Hot spots on popular users' replica |
| Session token + retry | Extra RTT on stale read | Retry storms if replicas lag |
| Sync local write (RYW) | Write waits for designated replica | Limits write path flexibility |
| Central session version store | Lookup RTT per read | Bottleneck if not sharded |
Qualitative rule: Session guarantees are cheaper than linearizable reads but may concentrate load on sticky replicas. Measure tail latency for power users with hot sessions.
CDN caveat: Edge caches break MR unless cache keys include session token or private cache per user.
11. Scalability Limits
- Sticky hot spots: Celebrity session pins one replica—uneven load.
- Token store: Global session metadata must shard by session id.
- Replica memory: Tracking per-session write set does not scale unbounded—TTL and scope limits.
- Stateless gateway ideal: Pure stickiness conflicts with elastic scale-out—prefer version tokens.
When session guarantees strain scale: Viral event with all users writing and reading—everyone needs RYW; consider regional write leaders with local session scope.
12. Operational Considerations
- Deploy runbooks: Verify affinity and token compatibility across releases.
- Monitor RYW SLO: Synthetic client writes then reads; alert on violation.
- Support playbooks: "Log out and back in" resets session—document side effects.
- Cache-Control headers:
privatefor user-specific RYW paths. - Incident correlation: Affinity loss often follows LB or K8s ingress changes.
13. Security Considerations
- Session token forgery: Attacker inflates version to force expensive read paths or bypass caches—sign tokens.
- Session fixation: Binding session to attacker-controlled replica route—validate server-side session id.
- Information leakage: Monotonic version in token reveals write activity—encrypt or use opaque server-side state.
- Cross-tenant stickiness bug: Wrong affinity exposes another tenant's RYW path—critical isolation review.
Session guarantees interact with auth session (login)—keep replication consistency session separate or unified deliberately.
14. Cost Considerations
- Infrastructure: Session store, stickier load balancers, reduced CDN cache hit rate for personalized content.
- Engineering: Gateway logic, cross-service header propagation, testing matrices.
- Opportunity cost: Cannot cache aggressively at edge for personalized reads.
- Savings vs linearizability: Avoid global quorum read on every request—often 10×+ latency reduction in principle; measure your stack.
Decision criterion: Pay for session guarantees when author-facing UX requires freshness; use pure eventual for aggregate metrics and public caches.
15. Production Implementations
Amazon DynamoDB
ConsistentRead on same item after write in same region provides read-your-writes for that item—scoped product guarantee. Global tables add replication lag caveats—check current AWS documentation.
Apache Cassandra
LOCAL_QUORUM with token-aware routing to write coordinator and replica set supports practical RYW for a session when clients reuse policy and datacenter context—implementation pattern, not automatic.
CouchDB / Cloudant
User database per user naturally provides RYW for that database—data model choice as guarantee.
Facebook TAO (described in literature)
Cache invalidation and sticky patterns for social graph—engineering blog details; verify against published architecture.
CDN + origin
Vary: Cookie or edge side includes for personalized fragments—session-aware caching implementation choice.
Distinction: Product docs state scope (per item, per region, per table)—architects must not over-generalize.
16. Alternatives and Tradeoffs
| Approach | Guarantees | Cost | Use when |
|---|---|---|---|
| Session guarantees | Per-session bounds | Medium | AP stores, user-authored content |
| Linearizable reads | Global real-time | High | Financial balances, inventory |
| Causal consistency | Cross-session happens-before | Medium-high | Collaborative editing, comments |
| Client-side CRDT | Local merge semantics | Engineering complexity | Offline-first apps |
| Strong leader reads | Near-linearizable per key | Leader RTT | When simplicity beats stickiness |
Tradeoff: Session guarantees do not help viewers see author's latest content immediately—need push, polling, or stronger model.
17. Common Misconceptions
| Misconception | Reality |
|---|---|
| "Eventual consistency includes RYW" | Pure eventual allows any stale read—RYW must be added. |
| "Sticky sessions alone guarantee RYW" | Replica may not have write if stickiness wrong replica or async lag. |
| "RYW = linearizability" | RYW is per-session; others may see stale; no real-time global order. |
| "JWT auth gives session guarantees" | Auth ≠ replication session; separate mechanisms. |
| "QUORUM read gives RYW" | Quorum may still be stale without versioning or routing to write replica. |
| "MR implies RYW" | Related but distinct—formal definitions differ; both often implemented together. |
18. Principal Architect Perspective
- End-to-end session — Trace from browser through API mesh to database; weakest link wins.
- Explicit session id — Prefer application-level token over opaque LB cookie only.
- Test on deploy — RYW canaries in CI/CD pipeline.
- Product communication — "Your edits appear instantly to you; others may see delay" — accurate.
- Upgrade path — Session guarantees → causal → linearizable per entity as business demands.
Interview signal: explaining how to implement RYW without linearizability separates principal candidates.
19. Architecture Review Exercise
Scenario: Multi-region comments API. Writes go to local region (eventual global replication). Reads through geo-routed load balancer with no session token. Users complain comments "disappear" after post.
Review prompts:
- Which session guarantee is violated?
- Design minimal fix preserving AP availability.
- Cost of linearizable reads for authors only?
- Should viewers have MR on comment thread?
- Mobile offline—additional guarantees needed?
Expected findings: Missing RYW; add session token or sticky write coordinator; consider causal for thread ordering.
20. Whiteboard Explanation
90-second version:
"Session guarantees are per-client promises on weakly consistent systems. Terry et al. defined four: read-your-writes—you never see stale data relative to your own writes; monotonic reads—your view never goes backward; monotonic writes—your writes appear in order; writes-follow-reads—causal order within your session. They don't make the whole system linearizable—other users can still see old data. You implement them with sticky routing to a replica that has your writes, or session tokens that force reads at least as fresh as your last write. They're the standard way to make eventual consistency usable for logged-in users without quorum reads on every request. Failures happen when load balancers lose affinity after deploy or CDNs cache personalized pages without private cache keys."
21. Interview Questions
-
Name four session guarantees.
- Signals: RYW, MR, MW, WFR; Terry et al.
-
Define read-your-writes.
- Signals: Own subsequent reads see own writes; session scoped.
-
How implement RYW without linearizability?
- Signals: Sticky replica, version token, local write ack + route.
-
RYW vs linearizability?
- Signals: Per-session vs global real-time order.
-
What breaks RYW on deploy?
- Signals: Lost stickiness, cookie change, new replica set.
-
Monotonic reads vs RYW?
- Signals: MR prevents regression; RYW about own writes specifically.
-
Session guarantees on CDN?
- Signals: Private cache, Vary headers, edge cannot serve stale personalized.
-
Cassandra and RYW?
- Signals: LOCAL_QUORUM, token-aware policy—not default ONE.
-
Cross-service session propagation?
- Signals: Headers, gateway, shared session version store.
-
MR without RYW possible?
- Signals: Theoretically distinct anomalies; discuss formal definitions.
-
Writes-follow-reads use case?
- Signals: Read balance then withdraw; must not act on stale balance.
-
Cost of sticky sessions at scale?
- Signals: Hot spots; prefer stateless tokens.
-
Mobile offline and RYW?
- Signals: Merge local queue with server reads.
-
Test session guarantees?
- Signals: Write-read loop canary, Jepsen session tests.
22. Interview Follow-Ups
-
Design comment system guarantees for authors vs readers.
- Signals: RYW for author; eventual for global feed; push notifications.
-
Migrate from stickiness to tokens—steps?
- Signals: Dual support, gradual rollout, monitor violations.
-
Session guarantees + CRDTs?
- Signals: Local merge satisfies strong local semantics; replication separate.
-
GDPR delete and session tokens?
- Signals: Invalidate tokens; session state TTL.
-
Executive wants Instagram-level freshness globally—response?
- Signals: Decompose; session vs global; fanout, caches, PACELC.
22A. Production Low-Level Design (Interview + Game Day)
Session token + sticky routing for RYW/MR without full linearizability. Production LLD and Game Day Standard.
Session model
| Guarantee | Mechanism | Storage |
|---|---|---|
| Read-your-writes | Sticky region + version cookie | session_id → region, min_version |
| Monotonic reads | Per-session last_seen_version | Edge cache bypass if stale |
| Writes-not-lost | Versioned PUT with client token | Dynamo-style vector optional |
Step-by-step flow:
| Step | Guarantee | Failure if skipped |
|---|---|---|
| 1–2 | Write durable | Lost update |
| 3 | Session state updated | Stale self-read |
| 4–6 | RYW enforced | User sees old prefs |
SLO
RYW violation rate = 0 for authenticated sessions; p99 read latency within EL budget.
22B. Game Day Playbooks
| # | Drill | Inject | Detect | Mitigate | Verify |
|---|---|---|---|---|---|
| GD-1 | Sticky miss | Route to wrong region | RYW canary fails | Fix affinity / sync read | User sees own write |
| GD-2 | Cache hides write | Long CDN TTL | Support tickets | TTL ≤ lag SLO | RYW restored |
| GD-3 | Token expiry mid-session | Invalidate session store | 401 storm | Graceful re-bind | No silent stale reads |
GD-1 — Read-your-writes violation
23. Strong Answer Example
Question: "We use eventual consistency. Do we need session guarantees?"
Answer this as a 45-minute design discussion using the PRACTICE framework. Below is how a strong student sounds aloud—yes for author paths, not "eventual will feel fine," and not "that means linearizability."

Figure A: PRACTICE map — Problem → Requirements → Assumptions → Capacity → Topology → Invariants → Constraints → Evolution.
Student interview script (PRACTICE)
P — Problem framing
"We're on an eventually consistent store—replicas lag. Pure eventual allows a user to write, get ACK, then read a lagging replica and miss their own write. That feels like data loss, even though the system is 'correct' under EC.
Session guarantees (Terry et al.) fix per-client anomalies without buying global linearizability.
Short answer: For logged-in author paths—yes, at least read-your-writes and usually monotonic reads. For public/viewer paths—often no, stay pure eventual. For metrics/aggregates—usually no."
R — Requirements
| Path | Need session guarantees? | Why |
|---|---|---|
| Edit profile / settings / comment then reload | Yes — RYW (+ MR) | Own write must be visible |
| Refresh feed of own posts | Yes — MR | UI must not rewind |
| Friend views your profile | Optional | Stale OK until converge |
| Analytics dashboards | No | Aggregates tolerate lag |
| Withdraw after reading balance | WFR / stronger | Don't act on stale read |
"I'll ask: which APIs are author vs viewer? I'll assume a typical web/mobile product with both."
A — Assumptions (state aloud)
| Assumption | Why it matters |
|---|---|
| Multi-replica / multi-region EC store | Random read can miss recent write |
| Client has a session (cookie, device, connection) | Scope of guarantees |
| Sticky LB alone is fragile | Deploys break affinity |
| Auth session ≠ replication session | JWT doesn't give RYW |
| Not linearizability | Others may still see stale |
"Session guarantees are client-centric safety on top of eventual liveness (convergence)."
C — Capacity (cost of the fix)
Quorum / linearizable read on every GET → expensive globally
Session token check / sticky subset → cheaper; hot sticky users possible
Synthetic write→read probes → low QPS, high signal
CDN personalized pages → must not break MR (private cache / Vary)
"I'd rather pay for tokens on author APIs than strong consistency on every public read."
T — Topology (draw this)

Figure B: Without guarantees—write ACK then stale read. With token/sticky—author sees own write; viewers may still lag.

Figure C: RYW, MR, MW, WFR — implement with version tokens (prefer) over fragile sticky cookies; propagate across services.
| Guarantee | Meaning (one line) | Default for author UX? |
|---|---|---|
| Read-your-writes (RYW) | After my write, my reads see it | Yes |
| Monotonic reads (MR) | My view never goes backward | Yes |
| Monotonic writes (MW) | My writes appear in order | Often yes |
| Writes-follow-reads (WFR) | Writes based on my reads respect those reads | When read→act |
Implementation I'd recommend:
- Primary: Session version token (last write version / vector) returned on write; gateway enforces reads ≥ token (retry or route to coordinator).
- Secondary: Sticky routing to write's replica set—helpful but not sufficient alone across deploys.
- Propagate token in internal headers so microservices don't break the chain.
- CDN: private cache /
Varyfor personalized fragments—or bypass CDN for author GETs. - Document per API in the catalog: RYW/MR required or not.
I — Invariants (safety)
"Non-negotiable when we say 'we need session guarantees':
- Scope = one session—not all users worldwide.
- RYW on author read-after-write paths—no 'disappearing' own edit.
- MR on author refresh—no UI rewind.
- Not a substitute for CP on money/security where global freshness matters.
- Stickiness loss must not silently drop RYW—tokens survive LB resets."
C — Constraints (second C)
| Constraint | Design response |
|---|---|
| Blue/green loses LB affinity | Prefer tokens over cookie stickiness |
| Multi-region geo-DNS | Home region + token; accept cross-region viewer lag |
| Mobile offline | Local queue + merge; RYW local first |
| Hot sticky celebrity | Cap stickiness; token-based routing |
| "We have JWT" | Separate auth from replication session state |
E — Evolution (prove it)
Phased delivery:
| Phase | Deliverable |
|---|---|
| M1 | Classify APIs: author vs viewer vs aggregate |
| M2 | Session token on writes; enforce on author reads |
| M3 | Propagate token across services; fix CDN |
| M4 | Synthetic write→read canaries; alert on RYW miss |
| M5 | Chaos: LB reset / region failover mid-session |
Failure modes:
| Failure | Mitigation |
|---|---|
| Post → refresh → old content | RYW token / sticky + verify |
| Deploy "fixes" stickiness | Token survives |
| Service B ignores token | Header contract + tests |
| CDN caches personalized HTML | Private cache / bypass |
Observability: RYW miss rate (canary), token retry count, sticky affinity loss events, p99 author read latency.
Closing line (interview)
"So: eventual consistency alone is not enough for logged-in author UX. I'd add session guarantees—at least read-your-writes and monotonic reads—via a version token at the gateway, not fragile LB cookies alone. Viewers can stay pure eventual. That's not linearizability: other users may still lag. I'd document it per API and probe write→read in prod."
Scoring signals
| Strong | Weak / red flag |
|---|---|
| Yes for author paths; optional for viewers | "No, eventual is fine" / "just wait" |
| Names RYW / MR (Terry) | Can't name guarantees |
| Token > sticky-only | "Sticky sessions solve it" |
| Not linearizability | Conflates RYW with global strong consistency |
| Cross-service propagation | Stops at one service |
| Canary write→read | No test story |
Compact outline (if time-boxed to 2 minutes)
"Yes for author read-after-write. Pure EC can hide your own write on a lagging replica. Need RYW + MR. Implement with session version token at gateway; sticky helps but deploys break it. Propagate headers. Viewers stay eventual. Not linearizability. Write→read canaries."
24. Weak Answer Example
Question: "We use eventual consistency. Do we need session guarantees?"
"No, eventual consistency means it will be consistent eventually, so users just need to wait."
Why weak / red flags: Ignores UX requirements and author-facing anomalies (missing own write); treats eventual as "feels consistent"; no RYW/MR, no token design, no per-API contract, no monitoring—standard practice on AP systems is to add session guarantees for logged-in paths.
25. Hands-On Exercise
Exercise: Session guarantee validation
- Deploy three-node replica set (or use local Cassandra/Dynamo emulator).
- Write from client A; immediately read without stickiness—record stale rate.
- Add sticky routing or version token; remeasure.
- Simulate LB reset mid-session; observe violations.
- Write ADR: which APIs require RYW/MR and implementation choice.
Success criteria: Demonstrated RYW violation and fix; documented session token format.
26. Knowledge Check
- Four session guarantees? (RYW, MR, MW, WFR.)
- Terry et al. year? (1994.)
- RYW scope? (Single session—not global.)
- Sticky routing pitfall? (Deploy affinity loss, wrong replica.)
- RYW vs consistent read in DynamoDB? (Product-scoped strong read per item—related but not identical to session model.)
- MR prevents what UX bug? (Timeline going backward on refresh.)
27. Flashcards
| # | Front | Back |
|---|---|---|
| 1 | Read-your-writes | Session reads never before own writes. |
| 2 | Monotonic reads | Session never reads older value than before. |
| 3 | Monotonic writes | Session writes visible in issue order. |
| 4 | Writes-follow-reads | Dependent write not visible before causally prior read. |
| 5 | Terry et al. (1994) | Canonical session guarantees paper. |
| 6 | Sticky routing | Affinity routes session to replica with writes. |
| 7 | Session token | Version cookie forcing minimum freshness on read. |
| 8 | vs linearizability | Session-local, not global real-time. |
| 9 | vs eventual | Session guarantees constrain interim anomalies. |
| 10 | PRAM consistency | Often MW + RYW combined. |
| 11 | CDN + RYW | Private cache or no edge cache for personalized reads. |
| 12 | Cross-region | Token must propagate or RYW breaks. |
28. Cheat Sheet
SESSION GUARANTEES (Terry et al.)
RYW - see own writes
MR - no read goes backward
MW - writes appear in order
WFR - reads before dependent writes
IMPLEMENT
- Sticky replica / coordinator
- Session version token + retry
- ConsistentRead (product-scoped)
- Propagate context across services
FAILURES
- LB affinity loss on deploy
- CDN public cache
- Cross-region without token
- Clock-based tokens
NOT PROVIDED
- Global freshness for other users
- Linearizability
- Multi-key transactions
29. Related Concepts
- Eventual Consistency — prerequisite baseline model
- Causal Consistency — cross-session happens-before
- Linearizability — global strong alternative
- Quorum Systems — replication mechanics underlying read freshness
- Vector Clocks — version metadata for session tokens
- Caching — edge cache interaction with session semantics
30. References
Primary sources
- Terry, D. B., et al. (1994). "Session Guarantees for Weakly Consistent Replicated Data." PDIS — definitions of RYW, MR, MW, WFR.
- Tanenbaum, A. S., & van Steen, M. (2017). Distributed Systems (3rd ed.) — PRAM and session-style consistency.
Engineering and production
- DeCandia, G., et al. (2007). "Dynamo: Amazon's Highly Available Key-value Store." SOSP — sloppy quorum, eventual model context for session patterns.
- Martin Kleppmann, Designing Data-Intensive Applications (O'Reilly) — Ch. 7 read-your-writes and monotonic reads.
- AWS DynamoDB documentation —
ConsistentReadsemantics (verify current docs).
Distinction
| Claim type | Source |
|---|---|
| Four session guarantees | Terry et al. (1994) |
| Implementation patterns | Engineering practice; validate per product |
| Cassandra RYW patterns | DataStax / Apache docs—driver and CL dependent |