Question

Difficulty: EasyProcess Azure Cosmos DB Change Feed Notifications

You are developing a solution that processes updates from an Azure Cosmos DB container using the .NET SDK v3 Change Feed Processor. The solution uses a monitored container and a lease container.

What is the primary purpose of the lease container?

  1. A
    To act as the primary partition key storage to avoid hot partition issues on the monitored container.
  2. To store the state of the change feed processor and coordinate the distribution of work across multiple compute instances.Answer
  3. C
    To lock and block access to individual documents in the monitored container while they are being updated.
  4. D
    To act as a temporary caching layer for read operations to bypass the session consistency limitations of the monitored container.

Answer

To store the state of the change feed processor and coordinate the distribution of work across multiple compute instances.
The lease container is a required helper container used by the Cosmos DB Change Feed Processor. It stores state information such as partition ownership leases and checkpoints (last processed offsets), which allows multiple instances of the processor to coordinate work and balance the processing load dynamically.

Step-by-Step Solution

1
Identify the primary architectural components of the Cosmos DB Change Feed Processor pattern.
The architecture contains a monitored container (source), a lease container (state store), a compute host, and a delegate.
Establishing the basic roles of each component helps isolate the purpose of the lease container.
2
Determine how the change feed processor tracks progress and distributes the workload dynamically.
The processor uses lease documents to keep track of checkpoints (offsets) for each partition and to negotiate partition ownership among multiple instances.
This shows that the lease container is dedicated to state-tracking and scaling coordination rather than caching or locking.
3
Select the option that matches this coordination and state storage functionality.
The correct option is the one stating that it stores the processor state and coordinates work distribution across instances.
This aligns directly with Microsoft's documentation and SDK v3 design guidelines.

Key Concept

Purpose of the lease container in Azure Cosmos DB Change Feed Processor
Rate this question