Primary Key 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:

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.

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

For details about procedure to enable legacy lookup strategy, see Enabling the Legacy Lookup Strategy.

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.

Migration of TIBCO BusinessEvents 5.x Projects

The new key-based lookup behavior is enabled by default. Under the new key-based lookup the concept and event entities have ID (@id) as object data type instead of Long. The *ByUri functions, such as, Cluster.DataGrid.CacheLoadConceptByExtIdByUri or Instance.getByExtIdByUri can be used for loading concepts and events. This is applicable for legacy as well as the new key-based lookup strategy. If your earlier project used the *ByUri functions implementation, then those functions can still be used. However, if the *ByExtId functions (such as, Cluster.DataGrid.CacheLoadConceptByExtId or Instance.getByExtId) were used, you must replace them with appropriate *ByUri functions; otherwise, TIBCO BusinessEvents Studio displays warning.

In order to continue using the old ID mode and avoid doing ID-related changes in your projects, you can modify the studio.tra file and the project CDD file to start TIBCO BusinessEvents Studio and engine in legacy Id mode. See Enabling the Legacy Lookup Strategy for more details.