Spring Session

Managing the session state is one of the important challenges in distributing and scaling web applications. HTTP is a stateless protocol. The state of the user interactions with web applications is typically managed in HttpSession.

It is important to have as little data as possible in a session. Focus on identifying and removing data that is not needed in the session.

Consider a distributed application with three instances, as shown here. Each of these instances has its own local session copy:

Imagine a user is being currently served from App Instance 1. Imagine if App Instance 1 goes down and the load balancer sends the user ...

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.