SwarmCache Hibernate 配置

发布于 2024-08-17 14:21:06 字数 83 浏览 8 评论 0 原文

谁能提示我如何配置 Hibernate 的 SwarmCache 以在集群(分布式缓存)中工作?可能还有其他选择(请不要建议 JBoss Cache)?

Could anyone hint me how to configure SwarmCache for Hibernate to work in cluster (distributed cache)? Probably there are some other alternatives (please, don't suggest JBoss Cache)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清引 2024-08-24 14:21:06

实际上,我不知道为什么 Hibernate 文档(参见 19.2. 二级缓存)没有提到它们是集群安全,但是OSCacheEHCache 可在集群环境中使用。可能是因为 Hibernate 没有正式支持它们。尽管如此,我知道两者都可以在分布式环境中工作,因为我使用 EHCache 做到了这一点,而 Matt Raible 则使用 OSCache 做到了这一点()。查看 Matt 的博客文章 OSCache 与 EhCache for Hibernate 二级缓存,内容非常丰富。

现在回到您的问题...很难给您准确的答案,因为您没有提供有关您的要求和限制的详细信息,但请考虑到:

  • JGroups 是一个用于可靠多播通信的工具包(请注意,这并不一定意味着 IP 多播,JGroups 还可以使用 TCP 等传输)。
  • 我对上一点的理解是,使用 JBoss Cache 并没有真正排除在外(参见 此矩阵适用于相关的 JGroups 版本)。所以这是一个选择。
  • SwarmCache 似乎已经死了(自 2003 年 11 月以来活动为零!)并且互联网上没有太多可用资源,我不会用它。
  • OSCache(失效)支持 JGroups 和 JMS 作为广播协议。这是一个选择。
  • EHCache 支持 Terracotta、RMI、JGroups、JMS、Cache Server 作为分发机制,并支持 失效和复制。这是一个选择。

现在,如果没有更多细节(复制与失效?您需要什么缓存并发策略支持?您的限制是什么?),我不能再说什么了。

Actually, I don't know why the Hibernate documentation (see 19.2. The Second Level Cache) doesn't mention them as Cluster Safe but both OSCache and EHCache are usable in clustered environments. Probably because Hibernate doesn't officially supports them. Nevertheless, I know that both do work in distributed environment because I did it with EHCache and Matt Raible did it with OSCache (patching hibernate is recommended though). Check out Matt's blog post OSCache vs. EhCache for Hibernate's 2nd Level Cache, it's very informative.

Back to your question now... It's hard to give you a precise answer as you didn't give much details on your requirements and constraints but take into account that:

  • JGroups is a toolkit for reliable multicast communication (Note that this doesn't necessarily mean IP Multicast, JGroups can also use transports such as TCP).
  • My understanding of the previous point is that using JBoss Cache isn't really excluded (see this matrix for the related JGroups version). So it is an option.
  • SwarmCache seems dead (zero activity since November 2003!) and doesn't have much resources available on the Internet, I wouldn't use it.
  • OSCache (invalidating) supports JGroups and JMS as broadcast protocol. It is an option.
  • EHCache supports Terracotta, RMI, JGroups, JMS, Cache Server as distribution mechanisms and supports both invalidation and replication. It is an option.

Now, without more details (replication vs invalidation? what cache concurrency strategy support do you need? what are your restrictions?), I can't say anything more.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文