Servlet session on Tomcat is managed by “Tomcat manager”. There are 3 kinds of session manager.
- Default manager (StandardManager)
- Delta manager
- Backup manager
Default manager (StandardManager) is non clustered session manager. That is, sessions are not shared between Tomcat instances. Without specific setting, default manager is used when we use servlet session api.
Delta manager and backup manager are clustered session manager.
- Implemented with org.apache.catalina.ha.session.DeltaManager
- All session data is shared among Tomcat instances
- Implemented with org.apache.catalina.ha.session.BackupManager
- Each session is composed of primary, backup, proxys
- If a session is created on a instance, another one instance is chosen as backup node. And all other nodes are proxy nodes
- Therefore, only one instance’s failure is allowed
- Each session has different primary, backup, proxy nodes
- Less communication cost than delta manager