- Install Terracotta.
- Configure iPoint instances.
- Configure hibernate to use EHCache.
- Configure Terracotta.
- Start Terracotta and Tomcat.
News: Clustering iPoint Portal with Terracotta
iPoint portal is an open source collaboration portal that supports JSR168 portlets and comes with a large number of portlets out of the box. iPoint deploys as a WAR file and stores its data in a database, using Hibernate as its persistence engine. By default it uses OSCache as a Hibernate cache. Previous attempts to cluster iPoint portal using OSCache clustering, based on JGroups have not been completely successful, due to the complex nature of the object relationships in the iPoint data model. Terracotta is an open source tool that allows objects in memory to be shared between Java virtual machines. It provides an integration with Hibernate based on its integration with EhCache. Terracotta advertises that it integrates with many applications with little or no code changes required. Terracotta also provides a method of clustering users’ HTTP session data between a set of Apache Tomcat instances. The objective of this exercise was to build a clustered set of iPoint portal instances, running on Apache Tomcat and using Hibernate with EhCache and Terracotta to provide a clustered view of the database. The clustering of users’ HTTP sessions is not in scope for this exercise, so the Terracotta integration with Tomcat was not tested. The steps required to integrate iPoint and Terracotta are described in the full article. Briefly, the steps were:
- Posted by: Matt Brasier
- Posted on: April 14 2008 11:21 EDT
- JBoss Cache + Hibernate by Manik Surtani on April 14 2008 15:02 EDT
- JBoss Cache + Hibernate + GridGain by Dmitriy Setrakyan on April 14 2008 20:19 EDT
JBoss Cache can be used as a clustered cache for Hibernate, and is one of the caching products that ships with Hibernate. http://wiki.jboss.org/wiki/JBossCacheHibernate An easy way to get any Hibernate-backed application clustered, and with no external servers, processes or systems to set up either. -- Manik Surtani http://www.jbosscache.org
In addition to JBoss Cache + Hibernate combination, which is a great way to cache-enable Hibernate-based applications, GridGain allows you to grid-enable the same application by partitioning your cached data across cluster/grid nodes. By adding GridGain into the mix you basically allow every cluster/grid node to become responsible only for a dedicated portion of data, and hence allowing to cache a lot more data, minimizing inter-cache communication, and removing any necessity for redundant data duplication within your cluster. On top of that, GridGain Affinity Load Balancing allows you to collocate your computation logic with your data which minimizes redundant data migration in the cluster close to zero. GridGain is an Open Source Grid Computing product available under the same LGPL license as JBoss Cache and integrates with it out of the box. You can see an example of JBoss Cache + GridGain combination here. Best, GridGain - Grid Computing Made Simple
Note that JGroups is *not* a cache, but a reliable transport to send point-to-point or point-to-multipoint messages between processes. Replicated caches (such as OSCache) can be *built* on top of JGroups. JGroups lives somewhere between messaging technologies like JMS and mere transport protocols like AMQP. Although JGroups ships with a bare bones replicated cache (ReplicatedHashMap), this was just a case study and is not the major goal of JGroups. Regarding OSCache: last time I checked, OSCache uses an old version of JGroups and I've had users report issues they found with the way OSCache uses JGroups. If you need a replicated transactional cache that works optimally with JGroups, I suggest take a look at JBossCache. Disclosure: I'm the author of JGroups and work for JBoss. Bela
Bela, The problems that we had with the OSCache/JGroups solution were with the OSCache side of things. The problem was that when updates were made to some of the more complex relationships in the iPoint model, OSCache did not propagate the change to the other cluster nodes. I have used used JBossCache as a Hibernate cache, but only with simple data models. Matt
Good to hear it wasn't a JGroups problem you had. It seems OSCache is not maintained any longer, but maybe I'm mistaken ... Cheers, Bela