session-guarantees · shipping · also Session consistency guarantees

Session guarantees

Session guarantees are consistency contracts for a session's operations, including read-your-writes, monotonic reads, monotonic writes and writes-follow-reads.

Related Observatory article: Read on hesela.com

Terry et al. defined four guarantees that a session can request independently over a weakly consistent replicated store. Each read or write runs at one server, and the guarantees restrict which servers are acceptable for it. For each operation the guarantee is either met or the application is told that it cannot be met. [1]

In the version-vector implementation, a session keeps 2 vectors, one covering its writes and one covering writes relevant to its reads, with one logical-clock entry per server. A server is acceptable when its own vector dominates the session vector that the operation checks. [1]

Implementations differ in where session context lives and what it promises. In one document store, causally consistent sessions provide all four guarantees under a partition only with majority read and write concerns, and in a 5-member replica set writes acknowledged by one member can roll back. [5] Another platform binds session tokens to partitions, and recreating a client loses its token cache. [4] A session is not an atomic transaction, and its label alone does not specify a durability contract.

Relations

related
Read-your-writes, Monotonic reads, Monotonic writes, Writes-follow-reads, Eventual consistency, Adaptive replica selection, Linearizability, Causal consistency

Advantages

  • Gives each client a view consistent with its own operations without coordinating all servers on every operation. [1]

Limitations

  • Requesting more guarantees narrows the set of acceptable servers and can lower availability. [1]
  • Guarantees bind only operations within one session, so a second session or client can still observe the same writes in another order. [1]

Citations

  1. Douglas B. Terry et al. Session Guarantees for Weakly Consistent Replicated Data. PDIS 1994, sections 1-4. (accessed 2026-10-22)
  2. Microsoft Learn: Consistency levels in Azure Cosmos DB; session consistency and partition-bound tokens. (accessed 2026-10-13)
  3. MongoDB Manual: Causal Consistency and Read and Write Concerns; durability and rollback distinctions. (accessed 2026-10-22)

Further reading

  1. MongoDB Manual: Read Isolation, Consistency, and Recency; client sessions, causal guarantees and isolation. (accessed 2026-10-13)
  2. Storage consistency: ordering is not a transaction or a durability promise (accessed 2026-10-13)
Sources & caveats
  • session-guarantees is Terry et al., PDIS 1994, read in full from an open copy.
  • mongodb-concerns is the MongoDB manual page on causal consistency and read and write concerns, read in full.
  • cosmos-sessions is carried over unchanged from the earlier revision.
  • Four guarantees, 2 vectors and one entry per server come from session-guarantees.
  • Majority concerns and the 5-member example come from mongodb-concerns.

JSON: /data/terms/session-guarantees.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Session guarantees. Hesela. 2026-11-10. https://hesela.dev/terms/session-guarantees/