Redis Stack as a session store
Now that we have seen the principal features of the two main data structures that can be created, indexed, and searched in Redis Stack, let’s consider a conclusive example to understand what the Hash and JSON data structures offer to one of the most classical use cases: the session store. In Chapter 2, Developing Modern Use Cases with Redis Stack, we highlighted the importance of making session data available outside of the application server for different reasons, such as the scalability of the session store, high availability, load balancing, and, in the case of a session store that uses Redis as a backend, achieving real-time performance.
Redis offers many options to store and retrieve data efficiently. However, sessions store different types of data: metadata, lists, geographical locations, and entire objects. Finding the right data structure, using low-complexity data access patterns, and managing session expiration in a highly concurrent...