HashPartitionResolver Class
Updated: June 30, 2017
HashPartitionResolver implements partitioning based on the value of a hash function, allowing you to evenly distribute requests and data across a number of partitions in the Azure DocumentDB database service.
Assembly: Microsoft.Azure.Documents.Client (in Microsoft.Azure.Documents.Client.dll)
| Name | Description | |
|---|---|---|
![]() | HashPartitionResolver | Initializes a new instance of the HashPartitionResolver in the Azure DocumentDB database service using the specified partitionKeyExtractor value. |
![]() | HashPartitionResolver | Initializes a new instance of the HashPartitionResolver in the Azure DocumentDB database service using the specified partitionKeyPropertyName value. |
| Name | Description | |
|---|---|---|
![]() | Dispose | Disposes the resolver in the Azure DocumentDB database service. |
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | Class destructor. (Overrides ObjectFinalize.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetPartitionKey | |
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ResolveForCreate | Given a partition key, returns the collection self-link for creating a document in the Azure DocumentDB database service. |
![]() | ResolveForRead | Given a partition key, returns a list of collection links to read from using its hash in the Azure DocumentDB database service. |
![]() | ToString | (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | IsDefined | Determines if a certain property is defined or not. (Defined by TypeCheckFunctionsExtensions.) |
![]() | IsNull | Determines if a certain property is null or not. (Defined by TypeCheckFunctionsExtensions.) |
![]() | IsPrimitive | Determines if a certain property is of premitive JSON type. (Defined by TypeCheckFunctionsExtensions.) |
Support for IPartitionResolver based classes is now obsolete. It's recommended that you use Partitioned Collections for higher storage and throughput.
The HashPartitionResolver class internally implements a consistent hash ring over the hash function specified in the IHashGenerator interface. By default, the HashPartitionResolver provides an MD5 hash function, but this can be swapped out with a different hashing implementation. The consistent hash ring creates 16 replicas for each collection in order to achieve a more uniform distribution of documents across collections.
The hash partitioning is most suitable for partitioning when the partition key has a high cardinality because it will distribute the data evenly across collections. Typically hash partitioning uses the id property. A common use cases for hash partitioning is data produced or consumed from a large number of distinct clients or for storing user profiles, catalog items, and telemetry data.
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


