Mapping keys to partitions with PartitionKey annotations

[Version 8.6 and later] A PartitionKey alias is used to identify the fields or attributes on which a hash code calculation is run to determine the partition to which data is saved. The PartitionKey annotation is only valid on key attributes.

Before you begin

You must be using eXtreme Data Format (XDF). For more information, see Configuring data grids to use eXtreme data format (XDF).

About this task

You set a PartitionKey alias to ensure that multiple classes save data to the same partition. For example, if you set the PartitionKey value to be the departmentID key, employee records are collocated on the same partition.

The PartionableKey interface is the existing Java interface and has precedence over the PartitionableKey annotation in C#.

Procedure