Web applications manage state information via HTTP sessions. Distributed HTTP sessions are required to support various features, such as:
Clusters – HTTP session information is distributed to support failover of HTTP sessions.
Load balancing – the same HTTP session information must be available on multiple servers simultaneously.
Types of distributed HTTP sessions include:
In-memory persistence – Provides a faster way of replicating and maintaining HTTP session state information in a single server instance.
Database persistence – Provides a reliable way to save session state information in persistent storage. While In-memory persistence is faster, some applications require a more permanent storage method or the ability to share session data among servers running in a cluster.
A combination of in-memory and database persistence – This is the method used in EAServer. It combines the speed of in-memory persistence with the reliability of database persistence. For this reason, it is used in EAServer. each node maintains a local in-memory copy of the data. When a client requests an HTTP session, it sends a version number indicating which version it requires. If the version number in the local in-memory copy is the same, then the data from memory is used, otherwise it is obtained from the database. After each request is processed, the version number increments (only if the data has changed) and the database is updated. This method reduces the number of database accesses in half.
Distributed HTTP sessions meet these requirements:
Optimized – clients that do not frequently update the session simply read the HTTP session information.
Portable – not tied to any one Web server implementation.
Reliable – database persistence provides reliable storage for session information.
Versioning – changes only when the session state changes.