I am working on a project that requires really high availability and my team is currently working on upgrading some infra-structure and software for a future release.
One of the features we would like to enable is to have session replication across not only different servers, but ideally across different sites (geographically spread). Is that possible? What are the approaches?
For what I have seen so far, to enable session replication, the usual vendor approaches are either one of these:
Are there other approaches? Should I go for in-memory replication? Or should I persist the session state? What app server vendors implement each solution?
Edit: I started a bounty, so I really am looking for a comprehensive answer. :)
Session replication is a mechanism used to replicate the data stored in a session across different instances. However, the replicated instance must be part of the same cluster. When session replication is enabled in a cluster environment, the entire session data is copied on a replicated instance.
This process creates a primary session state, which resides on the WebLogic Server to which the client first connects, and a secondary replica of the session state on another WebLogic Server instance in the cluster. The replica is always kept up-to-date so that it may be used if the server that hosts the servlet fails.
Tomcat provides in-memory session replication through a combination of serializable session attributes, "sticky sessions", which are provided by the load balancer, and specialized components configured in Tomcat's XML configuration files.
When in-memory replication is enabled for a web application, WebLogic Server copies session state from one server in the cluster (primary) to one other server in the same cluster (secondary). The replica on the secondary server is kept up-to-date so that it may be used if the primary server fails.
You might want to look at Hazelcast and their HTTP Session Clustering feature
If you're using tomcat then memcached-session-manager would be an option. It's a custom session manager that replicates sessions via memcached and supports both sticky and non-sticky sessions: http:// code.google.com/p/memcached-session-manager
Cheers, Martin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With