Performance enhancements by changing the firing location

The Business Rule Beans (BRBeans) framework allows you to specify where to fire a particular rule. This determines where the rule implementor is instantiated and invoked. The following lists the possible values for the firing location:

Local
Fires the Java rule implementor in the same JVM in which the trigger was performed.
Remote
Fires the Java rule implementor on the server where the rules exist.
Anywhere
Tries to fire the Java rule implementor locally. If the Java rule implementor cannot be found, then it fires the the implementor remotely. This is the default value.

For simple rule implementors that do not perform any server-intensive work, specifying Local usually results in the best performance. This is true both without and with caching. A complete comparison of local firing versus remote firing must consider four cases: local and remote firing without caching and local and remote firing with caching. A description of these four cases follow:

Remote call without caching

Without caching, the work done to fire a rule remotely involves the following:

  1. Finding the rule.
  2. Determining whether the rule is to be fired locally or remotely.
  3. Calling fire on the remote rule.
Each of these three operations requires a remote call to the server.

Local call without caching

Without caching the work done to fire a rule locally involves the following:

  1. Finding the rule.
  2. Determining whether the rule is to be fired locally or remotely.
  3. Calling fire on a local copy of the rule.
This requires only two remote calls. Firing locally results in a savings of one remote method call.

Local call with caching

With caching, local firing results in even more dramatic improvements. The work done to fire a rule remotely involves the following:

  1. Finding the rule. This involves a search of the local cache and does not involve calling the database.
  2. Calling fire on the remote copy of the rule found in the server's cache.
This requires only one remote method call.

Remote call with caching

The work done to fire a rule locally with caching involves the following:

  1. Finding the rule. This involves a search of the local cache and does not involve calling the database.
  2. Calling fire on the local copy of the rule found in the cache.
This does not involve any remote method calls. The entire rule firing process takes place locally without remote method calls. To get the full benefit of the BRBeans cache, use local firing. However, remotely fired rules still benefit from the cache due to the elimination of the query on the server and the elimination of the remote call to determine whether the rule is being fired locally or remotely.

There may be some cases where a rule implementor must perform some work that requires significant interaction with the server. In these cases, it may be beneficial to have rules using this rule implementor defined to be fired remotely. This might make the server interaction performed by the implementor more efficient.

Note: In addition to performance, maintenance also must be considered in relation to specifying a firing location. The rule implementor classes for rules that are defined to be fired locally must be present on any client system that tries to fire those rules. Otherwise, the implementor cannot be instantiated when the rule is fired. This can result in maintenance problems when the rule implementors are changed since they must be updated on many different systems.


Related concepts
BRBeans performance enhancements



Searchable topic ID:   cbrb_firloc
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/brb/concepts/cbrb_firloc.html

Library | Support | Terms of Use | Feedback