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 a typical 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, for 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. See Load Balancing and Fault Tolerance of Inference Agents for details.
Cache Clusters (Metaspaces)
A cache cluster (or metaspace, to use the TIBCO BusinessEvents DataGrid term) is a logical entity that provides the following services:
Fault Tolerance (of data): Notifications to inference agents so that the state of each agent’s working memory remains synchronized with the others, so any agent in the cluster can take over in event of a JVM failure.
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.
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 CDD Configuration Procedures in TIBCO BusinessEvents Administration.
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. You can deploy multiple instances of an agent class as an agent group. Each agent in a group runs in a different processing unit, concurrently, to enable load balancing when events come from a queue, and fault tolerance.
For more information see the following sections:
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 may use a lot more memory than expected because it often defers garbage collection. If JVM uses a large proportion of the physical memory available, then TIBCO BusinessEvents DataGrid may not perform well due to swapping. Because JVM and TIBCO BusinessEvents DataGrid are of the same process, they contend for the same addressable space. If the JVM uses a large proportion of the addressable space (which may occur on 32-bit systems where the addressable space is 4GB or less), then out of memory errors will occur in TIBCO BusinessEvents DataGrid. To avoid this situation, set the heap limit of JVM (such as Xmx-512m) to limit the amount of memory used by the JVM so it does not compete with TIBCO BusinessEvents DataGrid.
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