8

Is Terracotta a distributed cache?

Derek Mahar
  • 27,608
  • 43
  • 124
  • 174
  • 1
    never heard of it before, but googling for "terracotta distributed cache" gave me this: http://www.terracotta.org/confluence/display/labs/Distributed-Cache+Webcast – Bob Kaufman May 03 '10 at 21:05
  • 1
    Sounds almost like a homework question for some CS elective. o.0 – Amber May 03 '10 at 21:06
  • @Dav - the "why or why not" gives me pause, too. – Bob Kaufman May 03 '10 at 21:06
  • Which Terracotta product are you talking about? – Yishai May 03 '10 at 21:08
  • Terracotta platform for Java. Added a link in the question to the Terracotta website. – Derek Mahar May 03 '10 at 21:24
  • No, this is not a homework question. Are there actually any undergraduate computer science curricula that include study of Terracotta? In any case, I've removed the "Why or why not?" from the question. – Derek Mahar May 03 '10 at 21:27
  • @Bob Terracotta is known for many years for their JVM clustering solution (and now have a larger offer based on several products). – Pascal Thivent May 03 '10 at 21:34
  • The motivation for my question originates from a note in section "Being a Service Has Advantages" in "Chapter 1: Theory and Foundation" of the book "The Definitive Guide to Terracota" (http://apress.com/book/view/1590599861) which states, "Several members of the Java community refer to Terracotta as a distributed cache. As you can see from the fact that Terracotta's caches are internal, and external load balancing is required to optimize cache efficiency, Terracotta is not a cache. It merely uses caching technology to ensure application performance and scalability." – Derek Mahar May 04 '10 at 03:01

4 Answers4

10

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.

Yishai
  • 90,445
  • 31
  • 189
  • 263
  • Yes, I meant the open source Terracotta platform for Java. Added a link in the question to the Terracotta website. – Derek Mahar May 03 '10 at 21:24
8

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.

Rajendra
  • 1,703
  • 2
  • 16
  • 22
3

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

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
1

L2 cache is the one that is external to a processor (a JVM, in our case) and shared among them. Serving as a transparent L2 cache, Terracotta combines your multicomputer into a multiporcessor. Thus, it is a distributed cache. But, you seem not to get it because you are SW guys who have never imagined that it can be transparent. You expect that a cache is a thing that has get/set methods and coherence problem that you need to resolve at application level.

Read the "Definite Guide to Terracotta". The authors are literal saying that Terracotta is a distributed cache. I think they understand this better than anybody who says "no" replying here.

Val
  • 1
  • 8
  • 40
  • 64