Logical sessions
standardadvancedA logical session is a server-side identity for a sequence of related operations, created by the driver and identified by a session ID. It is not a network connection — the same session can span multiple connections, and a connection can carry operations from different sessions over time.
Think of it as
Think of it as a lightweight, server-tracked "conversation" a client can have with the cluster, separate from the underlying TCP connections doing the actual talking. It exists specifically to give the server something to hang causal ordering, retryability, and transaction state on, none of which a bare connection provides on its own.
What we're doing: Show a session enabling causal consistency: a read that is guaranteed to see a write made just before it, in the same session.
- 3
- Causal consistency is a property of operations sharing a session — it is this session identity, not the connection, that lets the server guarantee ordering here.
Why this works: Without a shared session, a write and a following read have no formal relationship the server can use to guarantee ordering — a session is what turns "these operations happened one after another, from the same logical actor" into something the server can actually reason about and enforce.
Remember: A session is a server-tracked identity for a sequence of operations, independent of any one connection — it is the foundation causal consistency, retryable writes, and transactions are all built on.
See also: sessions for transactions and retryable writes · transaction lifecycle and sessions

