When talking about application server clustering, I am often asked the question about whether JBoss AS supports buddy replication for HTTP or SFSB sessions. The simple answer is no, not yet. The more complex - and useful - answer though, is no, not yet, but there is a lot you can do with what we will be releasing in JBossCache 1.3 "Wasabi" (the underpinning technology used by JBoss Clustering).

 

 

Let's start with a simple question: what is buddy replication? Buddy replication is the ability to replicate session data to specific servers in a cluster and not to everyone. The goals of buddy replication are:

 

 

  1. to achieve failover by ensuring that collective state is maintained even if some servers in a cluster go down.
  2. to minimise network traffic that is a result of full replication of state to all servers in a cluster.
  3. to minimise memory usage which is a result of each server maintaining not only its own state but the state of every server in the cluster.
While buddy replication is on the JBossCache roadmap and is slated for release around summer 2006, there are other exciting, new features in JBossCache 1.3 "Wasabi", due for release in Feb 2006. These features can be combined to achieve a similar effect to buddy replication.

 

 

  1. To achieve durability of persistent data: a chaining cache loader should be configured with a ClusteredCacheLoader and a JDBCCacheLoader.
    • Use the ClusteredCacheLoader to quickly retrieve data from other caches in the cluster.
    • Use a shared JDBCCacheLoader as the 'true' representation of all state in the system.
  2. To minimise network traffic: JBossCache 1.3 "Wasabi" supports invalidation in addition to replication. If a cluster were configured with invalidation rather than replication, we have effectively minimised network load since invalidation does not replicate in-memory state but rather simply broadcasts very light invalidation messages.
  3. To minimise memory usage on cluster nodes: since data is not replicated to all servers in the cluster, all servers don't maintain all session data in the cluster. This results in each server maintaining only it's own state in memory rather than the state of the entire cluster.
So, if your cluster consists of a large number of servers, you can still achieve the goals of buddy replication using the above features.

 

 

For more information and details, see my wiki page on JBossCacheBuddyReplication