Book Image

Infinispan data grid platform definitive guide

Book Image

Infinispan data grid platform definitive guide

Overview of this book

Table of Contents (20 chapters)
Infinispan Data Grid Platform Definitive Guide
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Persisting data in Infinispan


Infinispan can use a CacheLoader interface to save the in-memory cache data to a persistent cache store, such as a database or text file. And during initialization, CacheLoader can pre-load the cache using data from the persistent cache store.

The following figure shows an Infinispan instance using a backend store:

The entries are fetched from the store lazily, when the get() operation can't find the value in the cache the cache loader enters in action. The object returned by CacheLoader will be stored into the cache and reused as a response to the get() request.

Once the entry is in the memory available for modifications, the underlying cache store is notified about any changes in the cache entry, so that the entries are properly synchronized in the persistent store.

Note

Starting with Version 6.0 and up, Infinispan has changed the way data is persisted, so if you stored data in an earlier version (using Infinispan 4.x or 5.x), you must perform a data migration...