Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 7 Distributed Cache OM : Distributed Cache and Multi-Agent Architecture and Terms

Distributed Cache and Multi-Agent Architecture and Terms
The drawing below illustrates Cache OM architecture.
Figure 6 Cache Object Management and Fault Tolerance Architecture
Different TIBCO BusinessEvents processing units and agents within the processing units have specialized roles in a Cache OM architecture. The following sections provide more detail.
The drawing illustrates one possible configuration, and assumes destinations that are JMS queues using basic load balancing (Content-aware load balancing is also available. See Load Balancing).
Agent group IA1 has three active agents, and agent group IA2 has two load balanced agents and one standby agent for fault tolerance. Each agent group is listening on a different destination.
Agent classes and processing units can be configured at deploy time (within the constraints of the project).
For more information about designing a project that uses multiple agents, see the following sections:
Cache Clusters (Metaspaces)
A cache cluster (or metaspace, to use the TIBCO BusinessEvents DataGrid term) is a logical entity that provides the following services:
You define the cluster member machines, processing units, and agents in the Cluster Deployment Descriptor (CDD) which is an XML file, configured in the CDD editor in TIBCO BusinessEvents Studio. See Chapter 23, Cluster Deployment Descriptor (CDD) and chapters following, in TIBCO BusinessEvents Developer’s Guide.
Processing Units
Each processing unit in a cache cluster runs in an instance of a Java virtual machine (JVM). It hosts one or more TIBCO BusinessEvents agents. Each processing unit with storage enabled participates in the distributed cache.
Processing units with inference agents also have an L1 Cache, a local cache that gives inference agents quick access to recently used objects.
Inference Agents
An inference agent executes rules according to the rule agenda created using the Rete network. In Cache OM systems, inference agents are connected to the cache cluster, enabling fault tolerance of engine processes and cache data, as well as load balancing (with queues).
At design time, you configure an inference agent class with a selection of rules from the project, and a selection of destinations, and, as needed, a selection of shutdown and startup functions.
Cache Agents
The purpose of cache agents is to store and serve cache data for the cluster. The built-in cache provider, TIBCO BusinessEvents DataGrid, calls such agents seeders. The Oracle Coherence cache provider calls them storage nodes.
Dedicated cache agent PUs are non-reasoning agents (one per PU). Cache agents are responsible for object management. They participate in distribution, partitioning and storage of the objects in the cluster.
Other Agent Nodes Functioning as Cache Agents  It is possible, but not recommended, to enable inference and query agent nodes to act as seeders (storage nodes) in addition to their other functions. Using dedicated cache agent nodes for data storage is more efficient and more scalable for production scenarios. Enabling storage on a different kind of agent can be convenient during testing.
When a backing store is used, you can balance what objects to keep in the cache and what to keep in the backing store, until needed.
Memory and Heap Size Guideline for Cache Agents
With TIBCO BusinessEvents DataGrid Cache Provider
The JVM can use much more memory than expected because it often defers garbage collection. If the JVM uses a large percentage of the available physical memory, TIBCO BusinessEvents DataGrid might not perform well, due to swapping. The JVM and TIBCO BusinessEvents DataGrid run in the same process; therefore they compete for the same addressable space in the RAM. If the JVM uses a large percentage of the addressable space, out of memory errors can occur in TIBCO BusinessEvents DataGrid. This situation is more likely to occur on 32-bit systems, where the addressable space is 4GB or less. To avoid this situation, set a heap limit to restrict the amount of memory used by the JVM, so that it does not compete with TIBCO BusinessEvents DataGrid. For example, you could use the command line option -Xmx512m.
With Oracle Coherence Cache Provider
With Oracle Coherence as the cache provider, the amount of memory you need for cache agents depends on factors such as how many objects you have, their object management configuration, and whether you are using limited or unlimited cache.
You must find an appropriate balance for your projects between too little memory, which leads to too much time spent in garbage collection, and too much memory, which leads to longer garbage collection cycles. The optimal heap size depends on factors such as how much data is kept in each cache agent, how many cache agents are used, and whether the cache is limited or unlimited.
For example, if you use a JVM heap size of 1024 MB (1GB), in order to minimize the impact of garbage collection, about 75% of the heap can be used to store cache items, which means about 768 MB per heap. The other 25% is then available for garbage collection activities.
Different operating systems have different requirements: adjust as required.
Query Agents
Query agents are available only with TIBCO BusinessEvents Event Stream Processing add-on software. Query agents use an SQL-like query language. You can query data that is in the cache. You can also query data arriving in events, known as event stream processing or ESP.
A query agent is a non-reasoning agent. It has read-only access to the underlying objects in the cache cluster. A query agent can execute rule functions, but not rules. You can mix query agents and inference agents within one node as desired.
TIBCO BusinessEvents Event Stream Processing Query Developer’s Guide explains how to work with the query language.
Dashboard Agents
Dashboard agents are available only with TIBCO BusinessEvents Views add-on software. They are similar to a query agent in that their role is to generate information based on queries. The information is made available to the TIBCO BusinessEvents Views dashboard. See TIBCO BusinessEvents Views Developer’s Guide for details.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved