Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do we need terracotta on top of ehcache for clustering?

I am doing to a proof of concept using ehcache as the cache provider.

Read somewhere saying we need terracotta server running, ALONG WITH ehcache to provide clustering.

Does ehcache alone provide clustering service or we need terracotta also?

Thanks, Venkat

like image 782
Venkat Teki Avatar asked Mar 12 '12 09:03

Venkat Teki


People also ask

Does ehcache support clustering?

The Ehcache Clustered Tier Manager is the server-side component that gives clustering capabilities to a cache manager. Cache managers connect to these to get access to the server's storage resources so that the clustered tiers of caches defined in them can consume those resources.

How does ehcache work?

The cache acts as a local copy of data retrieved from or stored to the system-of-record. This is often a traditional database, although it may be a specialized file system or some other reliable long-term storage. For the purposes of using Ehcache, the SOR is assumed to be a database.

Why do we need ehcache?

Ehcache is an open source, standards-based cache that boosts performance, offloads your database, and simplifies scalability. It's the most widely-used Java-based cache because it's robust, proven, full-featured, and integrates with other popular libraries and frameworks.

What is a clustered cache?

A cache cluster, also known as OracleAS Cluster (Web Cache), is a loosely coupled collection of cooperating Web cache instances working together to provide a single logical cache.


2 Answers

If you don't require clustering, but replication would suffice, ehcache comes with RMI replication bundled and has jgroups as well as JMS replication available:

see http://www.ehcache.org/documentation/2.7/get-started/cache-topologies.html#replicated-caching

like image 170
Alex Snaps Avatar answered Sep 22 '22 01:09

Alex Snaps


EhCache is not a distributed solution. So you need to use it with Terracotta to obtain the result you want. Like moodywoody said, you can use Hazelcast, but also Infinispan to obtain this result:

http://www.jboss.org/infinispan

like image 27
Alexis Dufrenoy Avatar answered Sep 22 '22 01:09

Alexis Dufrenoy