Show Table of Contents
Chapter 18. Cache Stores
The cache store connects Red Hat JBoss Data Grid to the persistent data store. Cache stores are associated with individual caches. Different caches attached to the same cache manager can have different cache store configurations.
Note
If a clustered cache is configured with an unshared cache store (where
shared is set to false), on node join, stale entries which might have been removed from the cluster might still be present in the stores and can reappear.
18.1. Cache Loaders and Cache Writers
Integration with the persistent store is done through the following SPIs located in
org.infinispan.persistence.spi:
CacheLoaderCacheWriterAdvancedCacheLoaderAdvancedCacheWriter
CacheLoader and CacheWriter provide basic methods for reading and writing to a store. CacheLoader retrieves data from a data store when the required data is not present in the cache, and CacheWriter is used to enforce entry passivation and activation on eviction in a cache.
AdvancedCacheLoader and AdvancedCacheWriter provide operations to manipulate the underlying storage in bulk: parallel iteration and purging of expired entries, clear and size.
The
org.infinispan.persistence.file.SingleFileStore is a good starting point to write your own store implementation.
Note
Previously, JBoss Data Grid used the old API (
CacheLoader, extended by CacheStore), which is also still available.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.