hibernate分布式二级缓存选项 [英] hibernate distributed 2nd level cache options

查看:315
本文介绍了hibernate分布式二级缓存选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不是真正的问题,但我正在寻找有使用以下一项或多项经验的人的意见/建议:

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


  • 带有RMI的EhCache

  • 带有JGroups的EhCache

  • 带有Terracotta的EhCache

  • Gigaspaces数据网格

  • 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.

关于第一个选项 - 是否有任何问题关于RMI的开销和Java序列化的性能?

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

推荐答案

我正在使用EhCache进行Hibernate和应用程序级缓存3年前。
我们将它与RMI一起用于缓存失效,它确实很好用。如果你使用缓存进行复制,你应该注意对象图,它可能会变得非常沉重,基数高。

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.

如果你使用EhCache进行Hibernate你可以使用它用于查询缓存(这是对只读表的一个很好的改进)并且表被修改它会自动清理缓存。
使用EhCache缓存集合也是一个好主意,以避免加入子选择。

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.

要按时间间隔清理缓存,可以实现缓存清除缓存的EhCache的扩展。我们做得很好。

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.

问候,
Jonathan。

Regards, Jonathan.

这篇关于hibernate分布式二级缓存选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆