Data Grid Invalidation cache on server/client mode
Environment
- Red hat OpenShift Container Platform (OCP)
- 4.x
- Red Hat Data Grid (RHDG)
- 7.x/8.x
Issue
- Setting up invalidation cache in DG 8 in client/server mode is recommended?
- Invalidation cache in DG 8 in client/server mode
Resolution
Invalidation cache does is not supported nor recommended in DG 8 client/server mode.
There is no valid use-case for invalidation-cache for server inside OCP.
Invalidation cache is a special use case for a shared persistence, there is no read optimization.
And the main use is if the cache is within the same JVM (aka embedded mode).
For client server - for instance in OCP 4 - there is no benefit at all.
What is Invalidation cache and how to set it up on JDG 7/DG 8
Invalidation is a clustered mode that does not share any data, but instead removes potentially obsolete data from remote caches. Using this cache mode requires another, more permanent store for the data such as a database.
Owners
Invalidation does not have owners, differently than distributed cache.
DG Operator Invalidation cache fails
DG Operator 8.3.x fails on Invalidation cache creation this is not a mistake, but rather because the server/client for Invalidation cache fails.
Usage of Invalidation cache DG 8 vs EAP 7
Invalidation cache, as described above, DG 8 client/mode is not supported nor recommended.
However, invalidation is the correct config for EAP (embedded cache) when using DG as a remote store. See solution JBoss EAP 7's infinispan CLI command to insert remote store cache and Externalize EAP 7 HTTP Sessions To RHDG 8.
In this regard, EAP 7 cache is a separate layer than DG 8 layer, where all reads/writes go to the EAP cache as normal. Writes also go through to the remote store in RHDG. Reads only go through to the cache store in RHDG if not found.
Root Cause
Invalidation cache should not be used in DG 8 client/server mode.
However, invalidation cache can be used in EAP 7 on the web session cache that gets offloaded to RHDG.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.