What are the different approaches for Java EE session replication?

4.4k views Asked by At

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:

  • Serializable session attributes
  • < distributable /> tag in the web.xml with additional configuration in vendor specific xml

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. :)

3

There are 3 answers

0
Lolo On BEST ANSWER

You might want to look at Hazelcast and their HTTP Session Clustering feature

0
MartinGrotzke On

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

1
pinichi On

Take a look at Oracle Coherence with HTTP session management module Coherence*Web.

It is in-memory basically but can be more persistence through DB or other storages.