This document describes why and how you should migrate applications using Terracotta DSO (Distributed Shared Objects) to using the standard Terracotta APIs in a standard (or "express") Terracotta cluster.
The main advantages of Terracotta standard clusters over DSO clusters are:
- Designed to Manage Huge Cached Data Sets
Caching brings with it a wealth of performance and simplification benefits. Standard Terracotta installations can take advantage of tiered caches, which in combination with BigMemory adds tremendous capacity, efficiency, and speed to cached data.
- Accessible APIs
Standard Terracotta products include powerful, easy-to-use APIs that work directly with the Terracotta cluster. For example, Enterprise Ehcache and the Terracotta Toolkit have APIs for implementing High Availability, searching, clustered maps, clustered Atomic classes, and more. Use of the standard APIs makes applications easier to build and maintain than with DSO. Using these APIs also frees your application from strict DSO configuration and synchronization requirements that can add substantial overhead to a project's integration phase.
- No Class Instrumentation
DSO requires all shared classes to be instrumented, but a standard Terracotta installation requires no class instrumentation. You can now share your objects automatically with Ehcache, Terracotta Web Sessions, or consider using a Clustered Map with the Terracotta Toolkit (see below). The class-portability issues of DSO are no longer a concern.
- Integration Without TIMs
Because classes do not need to be instrumented in a standard Terracotta installation, explicitly specifying TIMs in Terracotta configuration is not necessary. The DSO errors caused by missing or out-of-date TIMs are no longer an issue. Any frameworks, containers, or other technologies that could not be used with Terracotta due to the lack of a TIM can now be integrated with little effort.
- No Lock Configuration
The DSO requirement to understand Terracotta locking semantics and configure cluster locks is lifted in a standard installation.
Unlike Terracotta DSO clusters, standard Terracotta clusters use serialization. But with their built-in efficiency and substantial advances in streamlined functionality, standard Terracotta clusters have significantly lower implementation costs, higher performance, and improved stability.
The following sections specify the tasks you may need to perform to migrate from DSO to a standard Terracotta cluster.
DistributedCache to Ehcache
If your code used the Terracotta DSO cache known as Distributed Cache, you must switch to using the Ehcache API. Distributed Cache is supported only with DSO.
The standard Terracotta cluster requires all shared objects to be serializable, meaning that all classes must inherit or implement the Serializable interface. Ensure that any object to be shared across Terracotta clients is serializable.
The standard installation is tuned to minimize the overhead of serialization. A typical standard Terracotta cluster provides a substantial performance advantage over a DSO cluster because it does not require instrumentation and strict lock and transaction semantics.
Update Terracotta Configuration
Because classes do not need to be instrumented in a standard Terracotta installation, explicitly specifying TIMs in Terracotta configuration is not necessary. Any frameworks, containers, or other technologies you use with your application can now be integrated without using TIMs.
Collections to Caches
If you used DSO to cluster a data structure, such as an ArrayList, to store and manipulate data in memory, you can use Ehcache caches to do the same in a standard Terracotta cluster.
If using a cache is not an option, consider using a Clustered Map with the Terracotta Toolkit (see below).
The Terracotta Toolkit offers easy access to a simple and powerful API for integrating your application with Terracotta technology. Many of the tools used for sharing coherent data in a cluster are available through the Toolkit, including:
More Information on Using Terracotta Products
See the product documentation.