Search code examples
springspring-mvcjbossspring-webflow

Pros & Cons of Session Repliction


Do I really need Session Replication?

I am working on a number of web projects for a firm. Most of the projects are about one or two pages of input and then doing a save to a mysql database. Very Basic projects. My SA's are pushing to try to get session replication working in JBoss but I don't really see any need for it and all of its overhead.

We need load balancing and clustering so if the server does go down we can move the new requests to the backup service but I am not to big in session replication.

This is very low volume projects. I my eyes what is the odds of a user being in the project as the server goes down on the one or two pages.

I need to convince the SAs that session replication is an un-necessary complication in this instance. I am looking for pros and cons of session replication so that I can better structure my argument.


Solution

  • Well, the "pro" is that you have session failover, either in deliberate cluster member restarting or in inadvertent cluster-member failure. That's it.

    Some of the "cons" are:

    1. Session objects and their included objects have to be Serializable
    2. You have to choose Session persistence or replication and manage their configurations and/or datastore
    3. You have to think about Session persistence/replication policies (e.g. every write, request end, time scheduled) and still risk losing the session or losing the most current state of it if a failure occurs before recent changes have been stored/replicated
    4. Non-zero performance impact of replicating or or persisting, inversely related to how robust the replication policy is. (That is, the more likely that you'll get every session change replicated promptly, the worse the performance.)

    We do session replication because we considered failover to be an absolute requirement years ago when we started this, but I think if I had it to do over again I'd suggest we don't bother for the majority of our applications.