问题
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