Tomcat (version 5 here) stores session information in memory. When clustering of this information is periodically transmitted to other servers in the cluster to synchronize the situation. You can use a database repository to make sessions persistent, but this information is also recorded periodically and is used only to restore failure, and not to replace sessions in memory.
If you do not want to use sticky sessions (our configuration does not allow this, unfortunately), this causes a problem of session synchronization.
In other languages, web frameworks tend to allow you to use the database as your primary session repository. Although this poses a potential scaling problem, it makes session management very simple. I am wondering if there is a way to force tomcat to use the database for sessions this way (technically this will also eliminate the need for any clustering configuration in tomcat server.xml).
source share