Memory cache options for postgres and java
Running a last db server jersey applications and I need to start thinkin开发者_运维技巧g 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??
Any of the Java memcached libraries is probably your best best.
- Spymemcached
- Memcached-Java-Client
- Xmemcached
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.
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.
精彩评论