JVM Clustering

[Infragistics] Jess Chadwick / Wednesday, November 28, 2007

Load balancing across J2EE servers has long been a problem for administrators. While offloading some services to an EJB container is one partial solution, many development teams do not want to take on the responsibilities of developing EJBs. Recently, I became aware of two interesting alternative strategies for this problem: VMWare and JVM clustering.

VMWare, of course, allows you to run one OS inside another. Its used, for example, to "test drive" Linux servers inside Windows hosts. Its remarkably quick and clean, and I've been a fan of it for several years now. But until a few days ago, I was unaware of its abilities for clustering. In fact, you can use VM to spread an OS image across physical servers allowing them to operate as one "virtualized" server. In a J2EE context, this means that all cached data (applications, session, request etc) are transparently shared across the physical servers. While I haven't had a chance to set up and test drive this myself, I'm hearing very favorable reports from a few dev teams that are using it.

 Another approach is via the formerly-proprietary-but-now-open-source Terracotta project. Terracotta is a Java-specific product which allows a clustered JVM. Rather than distributing the entire OS, as VMWare does, you distribute the JVM only. Obviously this allows the sharing of session data without serialization, data replication, EJBs etc. Terracotta also supports a"disconnected" mode, meaning that data synchronization is automatic when a node drops out of the cluster and later reconnects. Importantly, this feature supports rolling updates.

A brief introduction to TerraCotta by Ari Zilka, its creator,  is available here

 So if you're dealing with clusters, load balancing etc. here are two products worth examining.