Chapter 6. Cache Modes

Red Hat JBoss Data Grid provides two modes:
  • Local mode is the only non-clustered cache mode offered in JBoss Data Grid. In local mode, JBoss Data Grid operates as a simple single-node in-memory data cache. Local mode is most effective when scalability and failover are not required and provides high performance in comparison with clustered modes.
  • Clustered mode replicates state changes to a small subset of nodes. The subset size is sufficient for fault tolerance purposes but not large enough to hinder scalability. Before attempting to use clustered mode, it is important to first configure JGroups for a clustered configuration. For details about configuring JGroups, see Section 26.2, “Configure JGroups (Library Mode)”

6.1. About Cache Containers

Cache containers are used in Red Hat JBoss Data Grid's Remote Client-Server mode as a starting point for a cache. The cache-container element acts as a parent of one or more (local or clustered) caches. To add clustered caches to the container, transport must be defined.
The following procedure demonstrates a sample cache container configuration:

Procedure 6.1. How to Configure the Cache Container

<subsystem xmlns="urn:infinispan:server:core:6.2" 
	   default-cache-container="local">
	<cache-container name="local"
			 default-cache="default" 
			 statistics="true"
			 listener-executor="infinispan-listener" 
			 start="EAGER">
		<local-cache name="default"
			     start="EAGER"
			     statistics="false">
			     <!-- Additional configuration information here -->
		</local-cache>
	</cache-container>
</subsystem>
  1. Configure the Cache Container

    The cache-container element specifies information about the cache container using the following parameters:
    1. The name parameter defines the name of the cache container.
    2. The default-cache parameter defines the name of the default cache used with the cache container.
    3. The statistics attribute is optional and is true by default. Statistics are useful in monitoring JBoss Data Grid via JMX or JBoss Operations Network, however they adversely affect performance. Disable this attribute by setting it to false if it is not required.
    4. The listener-executor defines the executor used for asynchronous cache listener notifications.
    5. The start parameter indicates when the cache container starts, i.e. whether it will start lazily when requested or "eagerly" when the server starts up. Valid values for this parameter are EAGER and LAZY.
  2. Configure Per-cache Statistics

    If statistics are enabled at the container level, per-cache statistics can be selectively disabled for caches that do not require monitoring by setting the statistics attribute to false.