Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Data Lookup Strategies

To get improved performance of entity lookups in cache and stores, and to make the lookup behavior more compatible with modern stores (databases), you can choose to use the key-based lookup strategy.

## Key-Based Lookup Strategy

The key-based lookup strategy is enabled by default. You can set a concept or event property as primary key using the Present in Key metadata setting in the CDD in `DomainObject Overrides`. You can also select more than one entity properties as Present in Key to have a composite key. You can use the `Cluster.DataGrid.CacheLoadConceptByKeysByUri` or `Instance.getByKeysByUri` catalog functions to load the concept.

If you do not mark an entity property as present-in-key then the `extId` becomes primary key for that entity. If `extId` is not provided for an entity instance, an internal `extId` is automatically generated for that instance.

You can also use the key-based lookup strategy and load a concept using external key or composite key then use the following settings:

- The `Cluster.DataGrid.CacheLoadConceptByKeysByUri()` and `Instance.getByKeysByUri` catalog function to load concepts using composite keys.
- The Present in Key column under Properties Metadata section of the entities override (Cluster > Object Management > Domain Objects > Overrides) setting in the CDD editor.

When you use the key-based lookup strategy, the `Cluster.DataGrid.`*ByExtId`` catalog functions are not available for use. You can use `Cluster.DataGrid.`*ByUri`` functions instead. Also, the `Instance.getByIdByUri` catalog function is not available. The object table is not used for store or cache lookups. Thus, in the CDD editor, the Preload Handles setting (Cluster > Object Management > Domain Objects > Overrides) is also not available.

## Legacy Lookup Strategy

The legacy (object table based) lookup strategy is disabled by default. The legacy lookup strategy is the entity lookup strategy where an entity instance can be fetched or loaded into working memory by specifying its Long ID or extId with or without specifying its URI.

For more details about object tables, see The Role of the Object Table.

## Difference Between Legacy and Key-Based Lookup Strategies

Difference Between Legacy And Key-Based Lookups
Legacy Lookup Strategy | Key-Based Lookup Strategy
--- | ---
Object Table is required to maintain index for cache and stores. | No object table is required.
The auto generated Long Id is always the primary key. | Concept or event properties can be made the primary key.
Composite keys are not available for data lookups. | You can use composite keys as primary key for data lookups.
Less compatible with modern stores. | More compatible with modern stores.
Use of `Id` is restricted as the primary key. | No such restriction. Default is `extId`, but you can define any property as the primary key.

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.