我们正在考虑为我们的应用程序实现一个缓存框架,以帮助提高我们网站的整体性能。
我们在 Websphere 6.1、Spring、Hibernate 和 Oracle 上运行。 当前的重点是静态数据或全天变化很小但使用量很大的数据。
所以任何信息都会很棒。 我已经开始谷歌搜索和阅读,但想了解一下对社区成员有用的内容。 我们感兴趣的事情之一是当底层数据发生更改时,系统能够使缓存失效。
谢谢
更新:
我在 IBM 网站上看到一篇文章,其中提到 Hibernate 的集群感知缓存与 WebSphere Application Server 的结合尚未确定; 因此,尚未确定是否支持它们的使用。
对此有何想法? 我们正在集群环境中运行。
We are looking at implementing a caching framework for our application to help improve the overall performance of our site.
We are running on Websphere 6.1, Spring, Hibernate and Oracle. The focus currently is on the static data or data that changes very little through out the day but is used a lot.
So any info would be great. I have started my google search and reading but wanted to get a feel for what has worked for members of the community. One of the things that we are interested in is the ability to have the system invalidate the cache when a change does happen in the underlining data.
Thanks
Update:
I came across an article on the IBM web site where it says that Hibernate's Cluster aware caches in conjunction with WebSphere Application Server has not been determined yet; therefore, is is not yet determined whether or not their use is supported.
Thoughts on that? We are running in a clustered environment.
发布评论
评论(5)
嗯,hibernate 缓存系统就是这样做的,我通过 Hibernate(和二级缓存系统)。
根据情况,Lucene 也可以是一个选项。 Hibernate 搜索 或 Compass 可以帮助解决这个问题(尽管这可能需要一些重大工作)。
使用 Terracotta 进行复制也可能是一种选择,尽管我从未这样做过。
Well the hibernate cache system does just that, I used ehCache effectively and easily with Hibernate (and the second level cache system).
Lucene could be an option too depending on the situation. Hibernate Search or Compass could help with that (although it might take some major work).
Replication using Terracotta could also be an option although I've never done it.
Hibernate 内置了一级和二级缓存。您可以将其配置为使用 EhCache、OSCache、SwarmCache 或 C3P0 - 您的选择。
Hibernate has first and second level caching built in. You can configure it to use EhCache, OSCache, SwarmCache, or C3P0 - your choice.
您还可以利用WebSphere 的默认缓存DynaCache 来实现二级缓存。 这将允许您利用 WebSphere 缓存基础设施来管理、监控和配置您的缓存
You can also leverage WebSphere's default cache i.e. DynaCache to implement the second level cache. This will allow you to administer, monitor and configure your cache leveraging WebSphere caching infrastructure
我使用过 ehCache 和 OSCache,发现 OSCache 更容易配置和使用。
I've used ehCache and OSCache and found OSCache to be easier to configure and use.
据我所知,Hibernate 实际上并没有执行上述操作 - 来自 Hibernate 的文档:
显然,这意味着缓存没有 ESP,并且无法判断不在集群中的应用程序是否在数据库上调用了直接 DML - 但我猜测您想要的是能够公开服务旧版应用程序在更新数据时挂钩并使缓存无效。 据我所知,没有关于如何做到这一点的建议。
From what I can see, Hibernate doesn't actually do the above - from Hibernate's docs:
Obviously what it means is that a cache doesn't have ESP, and can't tell if an app not in the cluster has called straight DML on the database - but I am guessing that what you want is an ability to expose a service for legacy apps to hook in and invalidate the cache when they do update that data. And there isn't, to my knowledge, a suggestion about how this might be done.