Dean Jacobs says "When you talk about clustering in J2EE, you have to think about, for each of the different APIs, whether it's JSP or EJB or JMS; you have to think about what's the state that needs to be managed in the cluster."
Read the text of theserverside interview or watch streaming video of the interview here.
What are some of the ways that J2EE vendors implement clustering?
When you talk about clustering in J2EE, you have to think about, for each of the different APIs, whether it's JSP or EJB or JMS; you have to think about what's the state that needs to be managed in the cluster. And generally there's three kinds of things we do associated with treatement of state. First is for stateless services. This would include all of the factories like EJBHome or a Connection Factory for JMS or a JDBC connection factory. Stateless services, you could put each one on a member of the cluster and switch between them at will; it doesn't matter which one you hit. So that's really about just load balancing. The next group of services are where you want to keep some kind of state in memory but it's not fundamentally persistent, it does not need to go to a disk. That would be a JSP Servlet Session state or a Stateful Session Bean. And for those there's issues about how you find it in the cluster. And a vendor may choose to do in-memory replication with say primary and secondary so if you lose the primary copy of the state, you could fail over to the secondary. Third class is services which are backed by state which is fundamentally persistent. This includes entity beans, JMS destinations, these sorts of services. And there a bunch of techniques around those such as caching things in memory or things like singleton services that allow you to maintain full transactional consistency with the backend database.