Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Using Terracotta for clustering or as a POJO-based Data Grid

Using Terracotta for clustering or as a POJO-based Data Grid

Two recent articles discuss Terracotta DSO. The first is an overview piece that walks through using Terracotta in a simple example. The second is an article describing how to use Terracotta to build a POJO-based Data Grid.

Joe Ottinger writes about getting started with Terracotta DSO (distributed shared objects). He walks through building a simple application that returns lists of words requested. Ottinger runs four tests of the application and discusses the results:

DSO requires a "host process," the actual DSO server itself. DSO clients run using a specific batch file provided by Terracotta DSO, "dso-java.bat". So we have four tests ahead of us: one is to run in single JVMs, the next is to run under a single client JVM with the DSO instance, then a run with multiple clients at one time, and then -- lastly -- a run with two clients, running sequentially.

...The first client run takes 49597 ms, which is equivalent to our original run. The second run, though: 1432 ms. This is a huge increase over the first run, and we had a 100% hit rate on our memoization, even though we had no memoization code for the first set of strings checked.

So what happened? It's pretty simple. The configuration file for DSO specified that the object root for the word list was to be managed by DSO, so when the word list is used by a client JVM, it checks to see if it has the current data in "local view." If it doesn't, it pulls what it needs from the DSO server; if the DSO server doesn't have it, then the local client builds it, and updates the DSO-managed instance.

Jonas Boner, a Senior Software Engineer at Terracotta, wrote the second article which describes how to build a POJO-based Data Grid using Open Terracotta. He describes what data grids are, how to build one using Terracotta, and then takes his simple solution and discusses what needs to be done to make it production worthy (i.e. handling large volumes of data, work failure, etc). Jonas develops his example based on the CommonJ WorkManager specification. In discussing why Terracotta is an appropriate technology for creating a POJO-based Data Grid, he says:

Even though it is in clustering, meaning scalability and high-availability, of Web and enterprise applications, that Terracotta can bring its most immediate value, it is really a platform for solving generic distributed computing and shared memory problems in plain Java code. This is something that makes it applicable to a wide range problem domains, for example building a POJO-based Data Grid.

Rate this Article