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?
- ATo act as the primary partition key storage to avoid hot partition issues on the monitored container.
- To store the state of the change feed processor and coordinate the distribution of work across multiple compute instances.Answer
- CTo lock and block access to individual documents in the monitored container while they are being updated.
- DTo 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
Key Concept
Purpose of the lease container in Azure Cosmos DB Change Feed Processor