Question

Difficulty: MediumProcess Azure Cosmos DB Change Feed Notifications

You are developing a distributed system that processes updates from an Azure Cosmos DB container using the .NET SDK v3 Change Feed Processor. You are configuring the lease container that will store the state and manage work distribution among multiple host instances.

Which of the following statements regarding the lease container configuration are correct? (Select TWO)

  1. The lease container must be partitioned by the `/id` path.Answer
  2. Multiple independent consumer applications can share a single lease container if they are configured to use a unique lease prefix.Answer
  3. C
    The lease container must use the same partition key path as the monitored source container to align physical partition boundaries.
  4. D
    The lease container must be configured with session consistency to ensure that checkpoint tokens are replicated correctly across client sessions.

Answer

The lease container must be partitioned by the `/id` path, and multiple independent consumer applications can share a single lease container if they are configured to use a unique lease prefix.
The Change Feed Processor uses the lease container to store state and coordinate processing across multiple hosts. The lease container must be partitioned by the `/id` path. Additionally, multiple independent processors can share the same lease container if they use distinct lease prefixes to distinguish their lease documents.

Step-by-Step Solution

1
Determine the partition key requirement for the lease container.
The lease container stores the state of the feed (checkpoints) and must be partitioned by `/id` to allow the Change Feed Processor to manage lease ownership.
This is a requirement of the Azure Cosmos DB SDK v3 Change Feed Processor architecture.
2
Determine how multiple independent consumers share the lease container.
Using a unique lease prefix for each workflow allows them to share the lease container without conflict.
The prefix distinguishes lease documents belonging to different consumer groups processing the same or different partitions.

Key Concept

Azure Cosmos DB Change Feed lease container configuration requirements
Rate this question