postgres 和 java 的内存缓存选项
运行最后一个数据库服务器应用程序,我需要开始考虑内存缓存。
大多数数据库命令每天仅更新一次。有机会在服务器级别缓存这些查询。
我有什么选择?我知道很多大型应用程序都使用 memcached。其他的??
Running a last db server jersey applications and I need to start thinking about memory caching.
The majority of the db commands are only updated once a day. There is an opportinity to cache these queries at the server level.
What options do I have? I know quite a few large applications use memcached. Others??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
任何 Java memcached 库都可能是您最好的。
Any of the Java memcached libraries is probably your best best.
Memcached 是一个很好的默认设置。可以用Redis。如果您选择使用它,它会提供更丰富的功能,但如果您的用例始终是 memcached 提供的功能,那么就没有什么特别的优势。
Memcached is a good default. Redis can be used to. It offers richer functionality should you choose to use it, but if you're use case will always be what memcached offers then there's no particular advantage.
请注意,PostgreSQL 有一个内部缓存(缓冲区缓存)并使用内核的磁盘缓存。因此,调整 PostgreSQL 配置以满足您的需求可能是一个好主意。
除此之外,您还可以使用物化视图来进行某些查询。
Note that PostgreSQL has an internal cache (the buffer cache) and uses the kernel's disk cache. So tuning the PostgreSQL config for your needs may be a good idea.
In addition to this you could use materialized views for some queries.