High-End Java Scalability Using Terracotta
The marketing tagline for the popular Terracotta platform (http://www.terracotta.org) pretty much sums up what this popular Network-Attached Memory system allows application developers to add into their apps. The slogan is: “Kill Your Database….Before You Kill Your Database”. They are referring to the unnecessary load you may be placing on your application database through repetitive queries of read-only or read-mostly data. Terracotta functions as a distributed object cache for Java applications and includes plugins for a host of popular frameworks and APIs, including Hibernate, Lucene, Quartz, and Spring. Terracotta supports distributed management of all applications objects in a server farm and, because it is a pure Java solution, it allows any serializable Java object to be stored natively into the distributed network-attached memory through a set of seamless API calls.
In fact, at its absolute simplest, no API calls whatsoever are needed….check out their “Hello Clustered World” example to see this magic in action (http://www.terracotta.org/web/display/orgsite/Hello+Clustered+World). In this example, a local variable in a class is used to store an integer value. This member variable is registered inside an application XML file that is passed to the Terracotta runtime as it starts up. Using reflection and other sophisticated capabilities, a running Terracotta Server Array is used to store the value of the member variable. When a second application instance is started up and it retrieves the variable’s value, it does so using the Terracotta Server Array. The effect of this is that all data is clustered across JVMs at runtime; as any data is updated, Terracotta handles reflection of those field-level changes across all instances in the cluster, as required. This obviously has a number of uses in most applications, from data caching and clustered data storage, to distributed session management for fault-tolerant, highly available applications. On the downside, however, it should be pointed out that Terracotta is a Java-only solution so if you’re building an application consisting of non-Java technologies (or as perhaps as part of a larger service-oriented architecture), it may not be a perfect fit.








