You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Crooke <da...@convio.com> on 2001/04/16 03:49:11 UTC

HA and failover - Re: saving session attributes across server machines

We are using a strategy where the information in the Java VM (session and
site-wide) is a read cache of what is in a relational database; any update is
persisted immediately, and there is a cache invalidation mechanism between
appservers. Since like most web apps we have a high read to write ratio
(something like 97% of pageviews are database read operations) this is highly
effective.

The one place where the facade breaks in our model is if a user has completed
half the steps of a multi-step form "wizard", then if an appserver fails in the
middle they lose their half-completed state and have to start over.

Bear in mind though that this is a *failure* condition. How common is an
appserver crash? How important is it to never lose a session?

I took the view that one session in a few million having this happen, when it is
easily recoverable by the user (just redo the form) was far more acceptable than
the considerable cost and slowdown of persisting the session state to the
database on every single pageview.

Likewise, our database setup only supports warm failover - if a DB server
crashes, it takes the other one 4 or 5 minutes to warm start that DB instance,
and meanwhile a number of our sites will be down. But how often does one crash?

You have to make an economic business decision about what level of fault
tolerance you require. With Java servlets, a multi-tiered cluster of machines
and a good RDBMS it is not difficult to assemble an extremely fault tolerant
system, just make sure that it is *necessary* first :-)

Cheers
Dave

Raul Valenberg wrote:

> Hi,
>
> We are designing a Web application with Servlets and JSPs that has to run on
> several machines in a fail-over mode. Each machine also has to participate in
> the workload as longs it is up. Furthermore, our requirements state that if a
> user session begins at one server, the fail-over to another server would be
> transparent to the client.
>
> I am looking for the right combination of technologies for this case.
> Does anyone have any experience with these kind of requirements using Tomcat?
>
> I though about using SUN JavaSpaces technology as a backbone for the Tomcat
> servers.
> Does this sounds logical? Has anybody have any experience with this type of
> combination?
>
> Thanks.
>
> Raul.
>
> ____________________________________________________________________
> Get free email and a permanent address at http://www.netaddress.com/?N=1