1

What is a full set of configuration one must make to work with cached table in spring data? Spring configurations are set via xml. So, I enabled cache like that

<cache:annotation-driven/>

and put @Cacheable("someCache") before findAll method.

I don't think that this is all configuration that I need. So, please, help me with caching if you have experience such things. And, please, advice what is the proper way to test such approach.

I know that it is possible to read all the table in collection and then just use collection, but I want to find more elegant way. The way that is already created by Spring/Hibernate developers. Thank you.

2

1 Answer 1

0

This is also something I am wondering. As I think about it I do undestand that caching a table is not an easy thing as it sounds. This can be done easily on the database level. But other than that it is not feasible. You won't be able to execute sql queries or join your cached table with non cached tables easily.

See how PostgreSQL has a solution for this: https://www.dbrnd.com/2018/04/postgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.