Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Terracotta a distributed cache?

Is Terracotta a distributed cache?

like image 529
Derek Mahar Avatar asked May 03 '10 21:05

Derek Mahar


3 Answers

Although you don't specify which product you are talking about, I'm going to assume you mean the open source platform itself. The short answer is no, but it can be used to write a distributed cache, and it has been in one of their own products (Ehcache).

You can see an overview of what the core engine is about here (it seems that they are hiding the information on their open source platform behind a registration wall now). It is a clustering engine that does not use J2EE technology, and its main purpose is to simplify distributed computing development. Besides caching, obvious use cases involve high availability and scalability needs. Think of it as enabling relatively plain java code to run "in the cloud" without having to worry about a lot of the details that that might involve.

like image 194
Yishai Avatar answered Sep 21 '22 17:09

Yishai


Terracotta has nothing to do with 'caching' although most implementations use it for caching purpose. Terracotta is about clustering and the terracotta itself is implemented using java (to my knowledge).

How Terracotta achieves clustering:

1) JVM1 running APP 2) JVM2 running APP (same) 3) JVM3 running APP (same)

Without Terracotta all JVMs are running independently with out knowing about each other performing some redundant tasks and maintaining their independent heaps

When you enable Terracotta (a Terracotta server running) across these 3 JVMs (configured to use Terracotta server)

Terracotta gives a logical view of all 3 JVMs as a single JVM. Any object graph that you designate to be stored at Server(Root ) is available to all 3 JVMs just like any local object but each JVM can can read/write to that object, whose changes are immediately(~) available to the other JVMs.

For this very reason Terracotta is used mainly for caching and distributed computing as idle JVMs with no work can process the work of the heavily loaded lagging JVM if the unit of work object is designated to be shareable.

like image 43
Rajendra Avatar answered Sep 18 '22 17:09

Rajendra


Your question is unclear (Terracotta has several products) but yes, the Terracotta Platform does offer a solution for Distributed Caching.

like image 30
Pascal Thivent Avatar answered Sep 21 '22 17:09

Pascal Thivent