java - 在 memcached 之前使用 ehcache

标签 java caching jakarta-ee memcached ehcache

我们有一个从数据库加载用户对象的网络应用程序。它是一个具有数千个并发用户的大容量应用程序,因此我们正在寻找缓存用户对象的方法,以最大限度地减少数据库负载。

目前正在使用 ehcache,但正在考虑使用 memcached 来降低应用程序的内存需求,并使其更具可扩展性。

我们目前在使用 memcached 时遇到的问题是序列化 User 实例带来的 cpu 负载。我们正在寻找加速序列化的方法,但也在考虑是否可以使用由 memcached 服务器支持的较小的 ehcache 缓存。

有没有人有过使用由 memcached 支持的 ehcache 的经验(即首先查看 ehcache,如果用户不在,则查看 memcache,如果没有则查看数据库)?

这种方法有什么缺点吗?

最佳答案

如果你愿意离开 Ehcache,你可以考虑 Infinispan ,现在包括与 memcache 的集成.它比 Ehcache 更容易工作,但不会太多。

Starting with version 4.1, Infinispan distribution contains a server module that implements the memcached text protocol. This allows memcached clients to talk to one or several Infinispan backed memcached servers. These servers could either be working standalone just like memcached does where each server acts independently and does not communicate with the rest, or they could be clustered where servers replicate or distribute their contents to other Infinispan backed memcached servers, thus providing clients with failover capabilities.

关于java - 在 memcached 之前使用 ehcache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5415042/

相关文章:

JavaFX : How to ask for user input before a GUI is displayed

caching - 如何清除docker容器内的缓存

java - XMLHttpRequest POST 之后下载 png 文件

java - 错误 : non-serializable attribute value into ViewMap

Android - Sencha Touch 2 PhoneGap 4.0.x 问题

jakarta-ee - @Singleton bean 在标记为 TransactionAttribute=NOT_SUPPORTED 时无法初始化,因为不是预期的事务状态 4

java - Spring AOP CGLIB 代理的字段为空

java - 使用仪器测量对象的大小

java - 我需要在表中单击 Ctrl+A 时启用按钮

jsp - 如果 scratchdir 是只读的,Tomcat 是否会在内存中缓存已编译的 JSP 页面?