Skip to content

Allow hierarchical partition keys for containers #805

@ivanl-out

Description

@ivanl-out

Describe the feature.

Cosmos DB supports hierarchical partition keys.

When a container is provisioned, instead of using PartitionKeyPath, one can use the PartitionKeyPaths property to specify the hierarchy, for example, ["/TenantId", "/UserId"].

Unfortunately ContainerInformation in this persister only allows for specifying a single partition key to be specified, which is used to enrich an outbox record with the specified partition key value. This effectively means that for containers with hierarchical partition keys, outbox cannot be used.

Given that this might be a large amount of work to support hierarchical partition keys in this persister (or simply an array of partition keys per container, since the order of the partition keys probably doesn't matter for this persister), as a workaround, we will be using a synthetic partition key instead, but it would be great if support for hierarchical partition keys were introduced in future.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions