When developing business process management solutions, you frequently require data that is expensive to fetch or compute. To obtain this data, you can connect to a database, invoke a Web service, and so on. If this data does not change over time, you can often achieve significant performance gains with the appropriate use of caching.
This tutorial shows a simple and effective caching technique to improve application performance based on the IBM Business Process Manager (BPM) product feature called DynaCache. DynaCache stores objects and later retrieves and serves them from its cache based on data-matching rules. It creates a unique user-defined "key" to store and retrieve cache items. Think of DynaCache as a sophisticated Java™ Hashtable. The code used to provide the in-memory cache services extends the Java Dictionary class, which is the abstract parent of the Hashtable.
The object cache instance is used to store, distribute, and share Java objects. The DistributedObjectCache and DistributedMap APIs are provided so that applications can interact with the object cache instances. Caches are stored in the JVM heap memory. If enabled, DynaCache supports overflow to disk when needed.
The default DynaCache instance is created if the DynaCache service is enabled in the Administrative Console. This default instance is bound to the global Java Naming and Directory Interface (JNDI) namespace using the name services, cache, and distributed map.
Each data request (meaning any invocation of a cacheable servlet, JSP, Web service, or other object) is associated with a set of input parameters that are combined to form a unique key called a cache identifier or cache-id. A key policy defines which cache identifiers result in a cacheable response. If a subsequent request generates the same key, the response is served from the cache. If a unique key does not match any rules, the response for the request is not cached. Figure 1 shows how DynaCache works.
Figure 1. Overview of DynaCache
Additionally, by using DynaCache, the complexities of cache data replication and synchronization between nodes in a network deployment topology are automatically and transparently handled by the infrastructure.
This tutorial covers the following topics:
- Creating the properties File
- Creating the business object and service interface
- Building the caching component
- Testing the caching component
- You must have hands-on experience with Java.
- You must be familiar with IBM Integration Designer (hereafter called Integration Designer), since it will be used as a development tool.
- Microsoft® Windows® machine
- IBM Integration Designer V7.5 installed with the test environment
This tutorial will take about 2 to 3 hours to complete.
In this tutorial, the following installation path variables and directories are used for the components:
- Integration Designer root:
- AppServer root: