Session-Consistency

Session-Consistency is a widely utilized Consistency Model in Distributed Systems and Cloud Computing. It is designed to provide a predictable data environment for individual users while maintaining the high performance and scalability of Distributed Databases. This model ensures that within a specific client session, the system provides Read-Your-Writes and Monotonic Reads guarantees.

In a Session-Consistency environment, a user who updates a record will immediately see that update upon subsequent requests within the same session. However, other concurrent users or sessions may continue to see older data until the update is replicated across all nodes. This approach is the default consistency level for services like Azure Cosmos DB because it offers lower latency than Strong Consistency while providing better guarantees than Eventual Consistency. For a deeper technical dive, refer to the Azure Cosmos DB Consistency Levels documentation and the Jepsen Consistency Analysis.

The implementation of this model often involves the use of a session token which the client passes to the server with every request to track the state of the Replication lag. This ensures the user never sees data that is older than their last write, effectively masking the complexities of the CAP-Theorem for the end-user.