---
title: "Ehcache集群随记"
author: "jlj008"
date: "2009-11-10T09:28:58Z"
tags: ["Cache", "Hibernate", "JMS", "Web"]
categories: ["企业架构"]
slug: "ehcache"
draft: false
lastmod: "2010-08-02T16:44:37Z"
id: 513364
url: "https://jimjiang.iteye.com/blog/513364"
---

Distributed Caching with ehcache

Ehcache is one of the dependencies of Hibernate, and we use Hibernate-3.2.5GA now, 
it depends on Ehcache-1.2.3 by default.
Ehcache's latest release is 1.7, some of the distribution mechanisms depend on the later version.

I recommend use RMI mechanism, and below is the list of ehcache distribution mechanisms:

* RMI
Since version 1.2
Simple configuration and match our default ehcache version requirements.
*** Recommended for our project ***

* JGroups
Since version 1.5
Simple confiugration, and it provides a very flexible protocol stack, 
reliable unicast and multicast message transmission.
But we need to update ehcache to 1.5+, it seems Hibernate3.2.5GA can work with ehcache 1.5+.

* JMS
Since version 1.6
Use JMS topic to advice subscribers update their cache.
And also we need to update ehcache to 1.6+ and do some code work to implement the publisher and subscribers.

* Terracotta
From version 1.7 Ehcache has been seamlessly integrated with Terracotta 3.1.1
This need another application for support cluster.

* Cache Server
A RESTful Web Services cache server.
Doing all kinds of cache operation through web service, and cache it on the cache server.