views:

384

answers:

6

Hi,

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?
+1  A: 

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.

Nikhil Kashyap
I interpret this solution as everything is dependent on a single point of failure, the Apache server running mod_jk2. Am I correct? If I am correct the solution has no higher availability than the network connection (i.e. one path only) and up-time of the Apache server itself?
DeletedAccount
+1  A: 

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

auramo
It looks interesting and the Amazon customers gave it good reviews. At the same time it has no focus on Java, but maybe that's not vital if it addresses lots of other relevant problem solutions.I'll look more into it! (I'll come back and up-vote if I like it) I still need something Java centric too,
DeletedAccount
+1  A: 

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

sapporo
+2  A: 

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

s0laris
These diagrams are very catchy! :)
cherouvim
+1  A: 

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

Kent Lai
+2  A: 

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.sun.com/jclingan/entry/glassfish_clustering_in_under_10

John Clingan, GlassFish Group Product Manager