Profile Definition Keys

You must define one or more keys for every valid profile definition. You can identify unique, primary, join, and hashing keys by examining the Key type property in the Advanced Attributes section in the Profile Definition Designer module of Business Desk or in the Advanced Attributes section of the selected property of the profile definition in Commerce Server Manager. This section describes how to define the following keys:

  • Unique key
  • Primary key
  • Join key
  • Hashing key

Unique Key

Every profile definition property marked as a key has the Unique Key attribute turned on. Only properties of string or numeric data types can be marked as keys. A profile definition can have any number of keys, although from a performance and memory perspective, it is better to have as few keys as possible.

All core profile object management operations in the Profiling System (CreateProfile, GetProfile, GetProfileByKey, DeleteProfile, DeleteProfileByKey) work with key members only. The Profiling System does not guarantee the uniqueness of properties that are marked as unique keys. Instead, it relies on constraints on objects in the underlying data stores (tables for relational databases or classes for directory stores) to implicitly enforce uniqueness.

Primary Key

Every profile definition must have exactly one unique key property marked as a primary key. You should mark the profile property most commonly used to operate on profile object instances as the primary key.

A primary key is identified by a red "P" or a green "D" (for a dual primary and join key) that precedes the property in the Profile Definition Designer module of Business Desk or in the profile definition of the Profiles resource in Commerce Server Manager.

Join Key

Every profile definition must have exactly one unique key property marked as a join key. For optimal performance, you should also mark the primary key on the profile definition as the join key. If you do not provide a value for the join key property when you create the profile object, then the Profiling System automatically generates a value for this member.

A join key is identified by either a blue "J" or a green "D" (for a dual primary and join key) that precedes the property in the Profile Definition Designer module of Business Desk or in the profile definition of the Profiles resource in Commerce Server Manager. The Profiling System uses the join key property to assemble profile object fragments stored in multiple data stores. Join key property values are replicated across all data stores.

Ee811617.note(en-US,CS.20).gif Note

  • After the join key property has been committed to the underlying stores, it cannot be updated.

Hashing Key

Every profile definition can have one unique key property marked as the hashing key. The profile aggregation layer uses the hashing key property to hash a profile object to a unique partition within a data source. The presence of a hashing key property is the only way to indicate that instances of a profile definition will be stored across multiple partitions of a data source. If this property is absent, all profile instances are stored in the default partition.

You should mark the join key on the profile definition as the hashing key. For optimal performance, you should mark the same property as the primary key, the join key, and the hashing key.

You can identify a hashing key by examining the Advanced Attributes/Hashing key in the Profile Definition Designer module of Business Desk or in the profile definition of the Profiles resource in Commerce Server Manager.

Ee811617.note(en-US,CS.20).gif Note

  • After the profile object has been committed to the underlying stores, the hashing key property value cannot be updated.

Ee811617.important(en-US,CS.20).gif Important

For partitioned ANSI SQL stores only, profile object retrieval operations based on a non-hashing key and the GetInfo method of the ProfileObject object could fail. However, this is not true for LDAP version 3-compliant stores.

The following figure shows the Key type drop-down box and the Hashing key check box highlighted in red.

Hashing Key Hashing Key check box Profile definition keys

Copyright © 2005 Microsoft Corporation.
All rights reserved.