Near cache scenario

Clients can optionally have a local, in-line cache when eXtreme Scale is used in a client/server topology. This cache is called a near cache: It is an independent eXtreme Scale that lives on each client, and is a cache for the remote, server-side core cache.

Near cache

A near cache is very fast as it provides in-memory access to a subset of the entire cached data set stored remotely in the eXtreme Scale servers. The near cache is not partitioned and contains data from any of the remote eXtreme Scale partitions. eXtreme Scale can have up to three cache tiers:
  1. The transaction tier cache contains all changes for a single transaction. The transaction cache contains a working copy of the data until the transaction is committed. When a client transaction requests data from an ObjectMap, the transaction is checked first.
  2. The near cache in the client tier contains a subset of the data from the server tier. When the transaction tier does not have the data, the data is fetched from the near cache and inserted into the transaction cache.
  3. The core cache in the server tier contains the majority of the data and is shared among all clients. The server tier can be partitioned, which allows a large amount of data to be cached. When the client near cache does not have the data, it is fetched from the server tier and inserted into the client cache. 4. The server tier can also have a Loader plug-in. When the server core cache does not have the requested data, the Loader is invoked and the resulting data is inserted into the server's core cache.
Figure 1. Near cache

The near cache is enabled by default when locking is configured as optimistic or none and cannot be used when configured as pessimistic. To disable the near cache, set the numberOfBuckets attribute to 0 in the client override eXtreme Scale descriptor configuration. See Map Entry Locking for details on eXtreme Scale's lock strategies.

The near cache can also be configured to have a separate eviction policy and different plug-ins using a client override ObjectGrid descriptor configuration. See the topic: Configuring an ObjectGrid client for details.

Sparse and complete cache

eXtreme Scale can be used as a sparse cache or a complete cache. A sparse cache only keeps a subset of the data and can be populated lazily, on-demand. Sparse caches are normally accessed using keys (instead of indexes or queries) since the data is only partially available. When a key is not present (a cache miss), the next tier is invoked and the data is fetched and inserted into the respective cache tier. If using a query or index, only the currently loaded values are accessed and the requests are not forwarded to the other tiers.

A complete cache contains all of the required data and can be accessed using non-key attributes using indexes or queries. A complete cache is preloaded with data prior to applications' using it. Once loaded, it can be treated similarly to a database. Since all of the data is there, queries and indexes can be used to find and aggregate data.