Setting up EHCache on Railo
One of the things I like about my current job at CONTENS is that we do a lot of work on the technical side of the platform just thinking up ways to improve overall performance. Caching and the ability to Cluster naturally plays an important role.
We support several different caching mechanisms in CONTENS but when in a clustering environment a distributed/replicated cache across cluster nodes is definitely something you need consider. Enter EHCache and the Railo Team
If you have been paying attention and updating your Railo Development machine you would have noticed that the new Caching menu went from (Experimental) to (Beta) when Railo went to version 3.1.2.
Setting up distributed EHCache is relatively easy, you need 2 or more Railo Servers. You first need to create a new Cache connection and Choose "EHCache" instead of RamCache, give your Connection a Name and click Create. On the next screen you can tinker with the settings in the first block or just leave them the way they are (best to leave them alone).
Change the settings to in the Distributed area (screenshot below) from Off to Manual, you can choose automatic and EHCache will find its own members with the same cache name but I think its better to go manual.
Once you have switched the Cache distribution from Off to Manual you can then insert members in the Manual portion, and set up the host in the Listener portion (see screenshot). What is important here is how the Cache members are defined.
//<dns name or ip>:<port>/<cachename>

Once you have done that you can start using EHCache for your caching needs.

Subscribe
Subscribe via RSS
Follow me on Twitter
Or, Receive daily updates via email.
Tags
adobe air ajax apple cf community cfml coldfusion examples ext flash flex google javascript max2007 max2008 misc open source programming railo software technology ui
Recent Entries
No recent entries.
Blogroll
An Architect's View
CFSilence
Rey Bango
TalkingTree

In order to do real distributed caching with Ehcache you need to install one or more copies of Ehcache server and communicate witht the cache via REST or SOAP.
Enter MemcacheD and EHCache remote. The current EHCache Distributed version is just one that you can replicate across a cluster. There are two additional extensions that allow you to use distributed Caches like EHCache remote or MemcacheD. We already use that for a larger customer of ours. But we still want to enhance it in order to be able to use an array of servers and have them behave as one. That can be easily done in EHCache but not in Memcached.
Please note that you can define as many caches as you like and in as many contexts as you like. The caches you use will have separate names which allow you to use functions like CacheGet() like this: CacheGet(key, "cachename"). The name of the cache is like a datasource so that you can use different implementations for them. More to come on our blog regarding this topic.
Gert Franz
Railo Technologies
Thats correct, in this implementation it is "simply" a replication of cache across multiple machines to keep the cache well in sync :). Later we will be implementing a real distributed cache, and hence the use of the slash between distributed and replicated in my post.