Reputation: 105
I am new to Spring cache abstraction. I have explored it using ehcache and apache ignite caching providers.
I want to know if spring cache abstraction supports the caching strategies of Write-behind and write-through.
Thanks, bs
Upvotes: 0
Views: 1186
Reputation: 14500
There is no direct support for cache-through in the declarative Spring abstraction.
And in a way it makes sense, since the abstraction lets you surround methods with caching related annotations. But with a cache-through pattern, the whole method would only be a cache interaction: a get
for read, or a put
for write. Not the if-then-else that the annotation abstracts.
However, if you use the CacheManager
and Cache
interfaces provided by Spring directly in your code, you can perfectly use them in a cache-through way.
Upvotes: 1
Reputation: 1795
Ignite cache has a notion of CacheStore
interface that used in cases when there is a need to wire the cache with a persistent store (RDBMS, MongoDB, Hadoop, etc.). This interface provides write-through/write-behind and read-through semantics. Please refer to this documentation for more details.
Also I would recommend taking look at various examples that demonstrates how particular CacheStore
implementations are used in Ignite. The examples are available in Ignite release bundles.
Upvotes: 1