此内容没有您所选择的语言版本。
Chapter 8. Set Up Invalidation Mode
8.1. About Invalidation Mode 复制链接链接已复制到粘贴板!
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.
Red Hat JBoss Data Grid, in such a situation, is used as an optimization for a system that performs many read operations and prevents database usage each time a state is needed.
When invalidation mode is in use, data changes in a cache prompts other caches in the cluster to evict their outdated data from memory.
8.2. Configure Invalidation Mode 复制链接链接已复制到粘贴板!
Invalidation mode is a clustered mode in Red Hat JBoss Data Grid. Invalidation mode can be added to any cache container, in both Library Mode and Remote Client-Server Mode, using the following procedure:
The invalidation-cache Element
The invalidation-cache element configures settings for the distributed cache using the following parameters:
-
The
nameparameter provides a unique identifier for the cache. -
If
statisticsare enabled at the container level, per-cache statistics can be selectively disabled for caches that do not require monitoring by setting thestatisticsattribute tofalse.
JGroups must be appropriately configured for clustered mode before attempting to load this configuration.
For details about the cache-container see the appropriate chapter.
8.3. Synchronous/Asynchronous Invalidation 复制链接链接已复制到粘贴板!
In Red Hat JBoss Data Grid’s Library mode, invalidation operates either asynchronously or synchronously.
- Synchronous invalidation blocks the thread until all caches in the cluster have received invalidation messages and evicted the obsolete data.
- Asynchronous invalidation operates in a fire-and-forget mode that allows invalidation messages to be broadcast without blocking a thread to wait for responses.
8.4. The L1 Cache and Invalidation 复制链接链接已复制到粘贴板!
An invalidation message is generated each time a key is updated. This message is multicast to each node that contains data that corresponds to current L1 cache entries. The invalidation message ensures that each of these nodes marks the relevant entry as invalidated.