To reference a relational database as external data, create an RDB reference definition that contains information about connection to the relational database.
This section explains the following items:
The items to consider when designing an RDB reference definition include:
Unit of creation
Only one RDB reference definition can be deployed per CEP engine.
Use of a time-limited cache
When a relational database is referenced for the first time, a query key and the results are stored in a time-limited cache of the CEP engine. Subsequent RDB referencing using the same key entails obtaining the data from the cache. To use a time-limited cache, you must set a cache retention period and a cache purge interval in the RDB reference definition.
Before using a time-limited cache, you must estimate the memory space required for the cache.
As the volume of data to be stored in the cache increases, memory usage in the CEP engine increases, so you must carefully consider the values to be specified for the cache.
The cache retention period is the period for which data is to be held in the cache. Specify a value in seconds from 0 to 2147483647.
The cache purge interval is the interval at which the cache is checked for the purpose of flushing the cache if the retention period has elapsed. Specify a value in seconds from 1 to 2147483647.
The concept behind the cache retention period and the cache purge interval is explained below.
If RDB data will not be updated
Setting a high value for the cache retention period poses no problem. Flushing a large volume of data from the cache causes garbage collection, and processing performance is temporarily degraded. Take into account the volume of data to be input to the cache, and set a cache purge interval that is unlikely to cause garbage collection.
If update of RDB data is expected
Even when RDB data is updated, the old cache data may be used for up to the cache retention period + cache purge interval. Set the cache retention period and cache purge interval according to the length of time for which the old data is to be used after the RDB data is updated. Data is held in the cache at each query, so it is possible that old data held in the cache may be obtained for some queries, and new updated data may be obtained for other queries. When designing rules for referencing a relational database, consider whether this situation is possible.