Session Management in Distributed Databases

Distributed databases partition the data across several nodes, spreading across regions depending on the database configuration. Such partitioning is fundamental to achieving scalability. All such cloud-native databases have some sort of a session management layer. A session, in plain terms, is the span of communication between a database client and server. It can span multiple transactions. I.e., in a given session, a client can do many writes and reads. The session management layer is usually responsible to guarantee “read your own writes”. I.e., data written by a user must be available for reading in the same session.

Session Consistency

In the distributed database world, with many regions serving the database, reads can happen from anywhere. There is fundamentally a need to distinguish between “Not Found” and “Not Available” scenarios. I.e. in the former case data does not exist while in the latter case data is yet to be seen by the region. This is important to provide “read your own write” guarantee. For example, let’s look at the time steps that happen in the below picture.

CategoriesUncategorized