Question

We're creating a web system using Java and Servlet technology (actually Wicket for the presentation layer) and we need our system to be available nearly always as our customers will be quite dependent on it.

This has lead us to look for a good book focusing on the subject or another resource which explains how to set up a more redundant and fail safe architecture for our system.

A non exclusive list of questions we have at the moment:

  • How do you have one domain name (like http://www.google.com) which are actually served by several servers with load balancing to distribute the users? Isn't there always a point which is weaker in such a solution(the two [as there can't be more] DNS servers for google.com in their case)?
  • It seems like a good idea to have several database servers for redundancy and load balancing. How is that set up?
  • If one of our web servers goes down we would like to have some kind of fail over and let users use one that is still up. Amongst other things the sessions have to be synchronized in some way. How is that set up?
  • Do we need some kind of synchronized transactions too?
  • Is Amazon Computer Cloud a good option for us? How do we set it up there? Are there any alternatives which are cost effective?
  • Do we need to run in a Java EE container like JBoss or Glassfish?
Was it helpful?

Solution

Regarding GlassFish, centralized administration through the admin GUI is a big help for environments with more than one appserver instance to manage. "Always available" is overloaded. It can be service availability with no session retention on failure, or it can mean data availability with session information backed up. Of course, GlassFish can do both. A couple of resources that may be of help regarding GlassFish and high availability:

Guide to GlassFish High Availability: http://www.sun.com/offers/details/glassfish_HAref_config.html

Setting up a GlassFish Cluster in 10 minutes: http://blogs.oracle.com/jclingan/entry/glassfish_clustering_in_under_10

John Clingan, GlassFish Group Product Manager

OTHER TIPS

The Liferay wiki has a high availability guide entry outlining an architecture that could serve as a starting point.

This is probably a simplistic approach, but I've implemented a similar kind of load balancing and high availability solution recently.
My application had Tomcat as the web container and MySQL database. I've fronted Tomcat with the Apache Http Server and used the Apache mod_jk2 module as the interface to handle load balancing and failover.

Plenty of resources are available on the web starting from the Apache documentation. Here are a few:

http://tomcat.apache.org/connectors-doc/reference/workers.html

http://www.redhat.com/docs/manuals/rhaps/jonas-guide/s1-load-balancing.html

http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html

For MySQL, check out MySQL proxy for load balancing and failover. Its a good idea to have more than one database servers for load balancing and fail over. one set of databases can be for reads and the other set for writes. Depending upon the volume, you might want to allocate more/less servers for read/writes. Your database documentation might also help you in the configuration.

HTH.

A friend of mine says that Building Scalable Web Sites is the definitive book on the subject:

Scalable Internet Architectures by Theo Schlossnagle might also be of interest.

I just finished reading Architecting Enterprise Solutions: Patterns for High-Capability Internet-based Systems. Excellent introduction for me on scalability, availability, performance, security, and a whole lot of other aspects for Enterprise Systems

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top