java - Multiple cache implementations at method level in Spring Boot -


what want is, 2 different cache implementations (let's redis , ehcache) on 1 method. meaning @cacheable method should cache both redis , ehcache.

is possible?

option 1: stack caches. configure local cache in spring. wire in distributed cache via cacheloader/cachewriter. consistency needs evaluated. e.g. if update goes distributed cache, how invalidate local caches? not trivial. maybe easy , not needed data, maybe near impossible.

option 2: go distributed cache provides called near cache. combination want yourself, combined in product. know hazelcast , infinispan offer near cache. however, mileage may vary regarding consistency , resilience. know hazelcast enhanced near cache, consistent.

interesting use case , common problem. further thoughts , discussion highly appreciated.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -