My DAL is implemented using Hibernate , and I want to use EHCache as my second level cache with its distributed capabilities (for scalability and HA).
After seeing that EHCache provides distributed caching with Terracotta , my question is, what is the role of the Terracotta server instance? Does it also contain data? Does it only support distribution coordination between the partitioned parts of the cache?
My confusion comes mainly from this explanation regarding the TSA, which says that the server stores data, but I think that maybe in my scenario the cache and Terracotta server are as if merged. Am I right? If the server really stores data, then why shouldn't the bottleneck just go from db to the Terracotta server?
Update: Affe's answer answered the second part of my question, which was an important part, but just in case someone comes by looking at the first part. I will say that the TC server must store all the data stored in the EHCache memory, and therefore, if you need a distributed cache (not replicated), then the L2 server (TC server) must also contain all the objects.
Thanks in advance,
Ephaya
java hibernate ehcache distributed-caching terracotta
Ittai
source share