This knowledge base article applies only to the Java version of Blueriq. The .NET version of Blueriq does not feature the caching mechanisms that are subject of this article.

Various plugins that are available for Blueriq add persistent data storage in external databases. Enabling these plugins often introduces performance penalties, as in-memory data management is being replaced by database interaction with an external system. Starting with release 9.4, caching mechanisms have become available that can help to reduce this performance penalty.

Where applicable, plugins contain a default cache configuration. As data usage patterns vary wildly, it is possible for customers to tune the cache configuration.

To change the default caching behavior, a configuration file is added to the spring.config.additional-location directory. The name for this configuration file must adhere to this format: <plugin-name>.ehcache.xml. The plugin-name placeholder is to be replaced with the name of the plugin (eg: processdao.ehcache.xml).

An example configuration is provided below. 

processdao.ehcache.xml example
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
	<diskStore path="java.io.tmpdir" />
	<defaultCache 
		maxElementsInMemory="25000" 
		eternal="false"
		timeToIdleSeconds="300" 
		timeToLiveSeconds="300" 
		overflowToDisk="true"
		diskPersistent="false" 
		diskExpiryThreadIntervalSeconds="300"
		memoryStoreEvictionPolicy="LRU" />
</ehcache>

The syntax of the configuration file is dictated by EHCache (version 1.2.3), the third party library that is used to manage the caches. Please refer to the documentation for detailed configuration options. In particular the XSD definition in ehcache.xsd is of interest.

Each plugin will instantiate a different set of caches. Using the "defaultCache" configuration option as shown in the example above, a "one-size-fits-all" configuration is provided. Cache-specific configuration can be added to fine-tune caching behavior. This requires the name of the cache to be added to the configuration. Please be aware that the set of caches used by an individual plugin (as well as the names of each of the caches) might be different in different versions of Blueriq. Such changes can be applied without notice.