Terracotta improves failover support, adds clustering for 5 more frameworks
Terracotta uses a hub and spoke architecture where the central server to coordinates heap changes across JVMs, pushing field-level changes to each server on an as-needed basis. The Terracotta "hub" prior to v2.3 was itself clusterable for fault-tolerance using an active/passive solution using shared disk (such as clustered NFS or SAN), which can be expensive. As of v2.3 Terracotta can cluster via multi-cast cluster of peer 2 peer Terracotta hub-servers (a separate tier from the actual application servers that are being clustered with Terracottta). Ari Zilka explained:
"Previously, the passive would come up and try to acquire the disk lock that the active was holding, the active would hold it until it crashed, then the passive would take over. You could even chain passives in any order. In 2.3 the definition of the active or passive is not based only who starts first and acquires a lock, it's based on a vote in a peer 2 peer cluster of Terracotta servers. Whoever is voted active becomes the active in an election process, and then evreything that is sent to him via the appserver tier he sends to the other guys multicast. They heartbeat each other and when he dies they all find out and start another election. Any one of the other passives can become the new active.The other major notable technical addition to v2.3 is the addition of cluster-membership notifications. According to Jeff Hartley, "if a node joins or leaves a cluster, a developer can make use of this information for example in grid computing type configurations," Ari continued: "this is helpful for our own user base which currently runs Terracotta DSO for clustering and then JGroups for membership status, our user community wanted cluster-membership events so they can stop using JGroups and stay pure-Terracotta).
Terracotta’s 2.3 also changes the way Terracotta integrates with other popular frameworks. Rather than having separate distributions of Terracotta for each framework, the single Terracotta downoad now includes "configuration modules" which provide pre-built configurations that customize Spring, Tomcat, and WebLogic, and additionally v2.3 adds pre-built support for Lucene, RIFE, Struts, Cglib, and iBatis for clusterability. JBoss is also officially supported now.
Explaining Terracotta in the context of other clustering solutions, Ari said:
What we're really introducing is the ability to inject high availability into the JVM, by allowing multiple physical JVMs to appear as one or more logical JVMs. So if you lose any one machine/instance you're not really losing anything it was working on because the other JVMs can seamlessly attach to the memory that JVM was working on. We're high availability at very high scales as opposed to scalability with reasonable guarantees of availability.Future version of Terracotta will include integrations with Glassfish, Wicket, and other frameworks. Work on an active-active failover strategy (having multiple active hub servers) is also being worked on for later this year. See also InfoQ's definitive introduction to Terracotta technical article, as well as Spring Webflow with Terracotta.