hibernate distributed 2nd level cache options

淺唱寂寞╮ 提交于 2019-12-07 12:16:35

问题


Not really a question but I'm looking for comments/suggestions from anyone who has experiences using one or more of the following:

  • EhCache with RMI
  • EhCache with JGroups
  • EhCache with Terracotta
  • Gigaspaces Data Grid

A bit of background: our applications is read only for the most part but there is some user data that is read-write and some that is only written (and can also be reasonably inaccurate). In addition, it would be nice to have tools that enable us to flush and fill the cache at intervals or by admin intervention.

Regarding the first option - are there any concerns about the overhead of RMI and performance of Java serialization?


回答1:


I'm working with EhCache for Hibernate and for application level cache since 3 years ago. We use it with RMI for cache invalidation and it works really good. If you use the cache for replication you should take care about the object graph, it could turn very heavy with high cardinality relations.

If you use EhCache for Hibernate you could use it for Query cache (it's a good improvement for read-only tables) and it the table is modified it cleans the cache automatically. Using EhCache to cache collections is a good idea too, to avoid joins a sub-selects.

To clean the caches at time intervals you could implement a cache extension of EhCache that cleans the caches. We did it a works good.

Regards, Jonathan.




回答2:


Also check out Hazelcast, Coherence and GemStone. These are distributed caching solutions with Query support. They also have ready-to-go second level cache plug-in for Hibernate. Hazelcast is open source.



来源:https://stackoverflow.com/questions/2928013/hibernate-distributed-2nd-level-cache-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!