Making session stores intelligent with in-memory databases
Session stores are a fundamental component to the majority of web-enabled applications, providing better session durability to drive consistent user experience.
There are various ways to manage user sessions but the challenge is for them to become more intelligent and scalable to meet the increase in user demand of a more personalised experience.
There are several approaches to consider when you opt to enhance your session store: adding analytics, migrating from a monolith to a microservices architecture, personalisation and more.
In this article, we look at Redis Labs’ Enterprise-ready In-Memory NoSQL database.
What are session stores and why they need to be made intelligent?
In a session-oriented application, the application stores all session-related data either in the main memory or in a session store – a database that does not lose the data when the application goes down.
A session store captures session data (user profile information, messages, profiles and themes, preferences etc) that is connected to a user of a service and stored separately from the primary database.
The data for these sessions is persisted through a cookie. The server gives a user a cookie, from this we can collect a string of data connected to that specific user.
Session stores are not essential for small use cases; however, as soon as your application becomes popular, you will find yourself running into problems with it becoming progressively slower. For a traditional session store to be intelligent, the data store must be able to capture intelligent data that might be calculated, inferred or otherwise not directly supplied by the user of the service.Some examples of the types of data available using an intelligent session store are:
- Group notifications - providing a single notification to a specific slice of users
- Content surfacing data - a dataset that can be leveraged for users to be pointed to additional content
- Activity data - information about the users’ behavior and usage of the service
- Personalisation data - data that can be used to make the service more specific and relevant to each user
- Why does it make sense to use a database as your session store?
- Why your session store should be a microservice?
- How do you use a database as a lightweight yet powerful transport mechanism?
- Can you implement a session store that includes calculated data?
- How will using a database session store improve your application’s pattern monitoring and personalization?
Creating a session store microservice backed by the unique features of Redis Enterprise In-Memory database allows for scalable and data-rich patterns that would be otherwise impractical to implement in monolithic architectures. The data can be stored and retrieved from the session store and can also include probabilistic and analytical data alongside more traditional session data.
To read more about how to implement intelligent session stores using Redis Enterprise download our whitepaper here.