Ehcache with terracotta server for hibernate

35 views
Skip to first unread message

kaizokun

unread,
Oct 21, 2019, 4:30:56 AM10/21/19
to ehcache-dev
Hello,

I made a few test with ehcache as a second level cache for Hibernate and it's great. 

In my production environnent my application is horyzontally scaled so I need a solution to update the cache of every other instances of 

service anytime the database and the local cache of an instance is updated.

Terracotta server in combination with Ehcache seem to be a good solution but is it the case ? 

And also is it free or are there limitations ? This is for a personnal project.

Thanks !

Chris Dennis

unread,
Oct 21, 2019, 8:41:51 PM10/21/19
to ehcac...@googlegroups.com
That should be a good solution, although your statement “anytime the database and the local cache of an instance is updated” leaves things a little vague. Let me clarify: if you always modify the database through your application and make sure to make the corresponding updates to the cache (or invalidations) at the same time then this will work fine.

Terracotta is OSS and so you can download and use it for free. The main limitation is that you cannot have a ‘persistent’ clustered cache. This means if the cluster server dies then the contents of the cache are lost. For HA purposes this can be ameliorated by running a pair of servers in an “Active + Mirror” setup. This way if the active server dies the passive will take over.

--
You received this message because you are subscribed to the Google Groups "ehcache-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-dev/76151cd7-883a-4b1e-9560-15c3027944c7%40googlegroups.com.

kaizokun

unread,
Oct 22, 2019, 1:59:30 AM10/22/19
to ehcache-dev
Thanks for your answer, 

I always pass trough Hibernate to manipulate the datas so I guess I just need the right configuration. 

But I'm not sure how Ehcache and Terracotta works, if it is an embedded cache or a centralized one that can be duplicated or a mix of two. 

I was testing another concurrent solution, and they have two (or three) differents approches : embedded cache, client server with multiple mirros caches, and a mix of the two, client server with a near cache 

(An embedded cache that contain the most used datas). Apparently it is possible to propagate the changes to the centralized datas (invalidations) when the near cache is updated. 






Le mardi 22 octobre 2019 02:41:51 UTC+2, Chris Dennis a écrit :
That should be a good solution, although your statement “anytime the database and the local cache of an instance is updated” leaves things a little vague. Let me clarify: if you always modify the database through your application and make sure to make the corresponding updates to the cache (or invalidations) at the same time then this will work fine.

Terracotta is OSS and so you can download and use it for free. The main limitation is that you cannot have a ‘persistent’ clustered cache. This means if the cluster server dies then the contents of the cache are lost. For HA purposes this can be ameliorated by running a pair of servers in an “Active + Mirror” setup. This way if the active server dies the passive will take over.

On Oct 21, 2019, at 4:30 AM, kaizokun <mon...@gmail.com> wrote:

Hello,

I made a few test with ehcache as a second level cache for Hibernate and it's great. 

In my production environnent my application is horyzontally scaled so I need a solution to update the cache of every other instances of 

service anytime the database and the local cache of an instance is updated.

Terracotta server in combination with Ehcache seem to be a good solution but is it the case ? 

And also is it free or are there limitations ? This is for a personnal project.

Thanks !


--
You received this message because you are subscribed to the Google Groups "ehcache-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ehcac...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages