Introduction: Dynamic cache
The dynamic cache engine is the default cache provider for the dynamic cache APIs and framework. However, starting with v6.1.0.27, dynamic cache allows WebSphere eXtreme Scale, which is the is the strategic direction for caching for the WebSphere products, to act as its core caching engine.
We can use the admin console to replace the default dynamic cache provider with the WebSphere eXtreme Scale provider, without changing our existing dynamic cache caching code. WXS offers improved transactional support, scalability, and high availability.
The WebSphere eXtreme Scale dynamic cache provider:
- Supports memory-to-memory replication for sessions.
- Can handle all of the generic data and session caching needs of the applications.
- Enable the applications to leverage system memory without using SAN or storage solutions to host a dynamic cache disk cache.
- Provides a scalable replicated cache with a configurable number of replicas, thereby eliminating the need to use the data replication service (DRS), which the default cache provider uses. Use of DRS sometimes causes performance problems.
- Can be configured with additional WXS containers at runtime, thereby increasing the cache capacity, and preventing performance issues that sometimes occur when we use DRS. WXS automatically redistributes the partitions as new containers are added to the grid.
- Provides better caching qualities of service and control, than the default cache provider.
- Uses the same runtime monitoring and administration tools as the classic dynamic cache. These tools, such as the cache monitor and the dynamic cache runtime MBean, work the same way when dynamic cache runs on WXS, as when they are used with classic dynamic cache.
Functional differences between the default cache provider and the WebSphere eXtreme Scale dynamic cache provider
Following is a list of functional differences between the default cache provider and the WebSphere eXtreme Scale dynamic cache provider:
- WXS dynamic cache provider does not include disk cache support because all cache data is kept in memory. Therefore, the disk caching custom properties are not supported.
- WXS dynamic cache provider does not support the following features:
- DistributedNioMap - skipMemoryAndWriteToDisk
- DistributedMap and DistributedNioMap alias
- Disable dependency IDs or templates
- WXS dynamic cache provider does not support DRS style replication.
Therefore, the DRS custom properties are not supported. When we use the WXS dynamic cache provider, replication configuration is controlled by the WXS deployment and definition files.
- DistributedNioMapObject.release() is not called to release the byteBuffers for NIO buffer Management.
- WebSphere eXtreme Scale dynamic cache provider has limited PMI support.
Certain PMI and MBean counters are no longer valid. See: Configure the dynamic cache provider for WebSphere eXtreme Scale
- When firing any event, ObjectGrid always sets the sourceOfInvalidation to REMOTE
- Use the DynaCache API to register event listeners regardless of which cache provider we are using.
However, if we use WebSphere eXtreme Scale dynamic cache provider, the event listeners work as expected for local in-memory caches. When co-located containers are being used, events are thrown on the machine where the request that caused the event is serviced instead of on the machine where the request originated. For example if an invalidate request is issued on Server A and the cache entry that gets invalidated is actually stored on Server B, then the event will be fired on Server B. With the default dynamic cache provider, the event is fired on Server A. When stand-alone containers are being used, no events are fired through the DynaCache event listener API.
Key concepts pertaining to the dynamic cache service
- Cache instances
- An application uses a cache instance to store, retrieve, and share data objects within the dynamic cache.
- Use the dynamic cache service to improve performance
- Caching the output of servlets, commands, and JSP improves application performance. WebSphere Application Server consolidates several caching activities including servlets, web services, and WebSphere commands into one service called the dynamic cache. These caching activities work together to improve application performance, and share many configuration parameters that are set in the dynamic cache service of an application server.
- Configure dynamic cache to use the WebSphere eXtreme Scale dynamic cache provider
- Configure the dynamic cache service to use WebSphere eXtreme Scale lets you leverage transactional support, improved scalability, high availability, and other WebSphere eXtreme Scale features without changing our existing dynamic cache caching code.
- Configure servlet caching
- After a servlet is invoked and completes generating the output to cache, a cache entry is created containing the output and the side effects of the servlet. These side effects can include calls to other servlets or JSP files or metadata about the entry, including timeout and entry priority information.
- Configure portlet fragment caching
- After a portlet is invoked and completes generating the output to cache, a cache entry is created containing the output and the side effects of the portlet. These side effects can include calls to other portlets or metadata about the entry, including timeout and entry priority information.
- Eviction policies using the disk cache garbage collector
- The disk cache garbage collector is responsible for evicting objects out of the disk cache, based on a specified eviction policy.
- Configure the JAX-RPC web services client cache
- The web services client cache is a part of the dynamic cache service used to increase the performance of web services clients by caching responses from remote web services.
- Cache monitor
- Cache monitor is an installable web application that provides a real-time view of the current state of dynamic cache.
We use it to help verify that dynamic cache is operating as expected. The only way to manipulate the data in the cache is using the cache monitor. It provides a GUI interface to manually change data.
- Invalidation listeners
- Invalidation listener mechanism uses Java events for alerting applications when contents are removed from the cache.
Related:
Eviction policies using the disk cache garbage collector Cache instances Cache monitor Invalidation listeners Task overview: Using the dynamic cache service to improve performance Configure servlet caching Configure portlet fragment caching Configure the JAX-RPC web services client cache Configure dynamic cache (DynaCache) to use the WebSphere eXtreme Scale dynamic cache provider