Question

Difficulty: MediumProcess Azure Cosmos DB Change Feed Notifications

A telemetry ingestion system processes device readings stored in an Azure Cosmos DB container. You are deploying multiple instances of a .NET background service to process changes in parallel using the Change Feed Processor. All instances will share a single lease container. To ensure that the workload is distributed across all running instances of the background service rather than having them duplicate processing, which configuration strategy should you apply?

  1. Initialize the change feed processor on all instances with the same processor name, but assign a unique instance name to each host.Answer
  2. B
    Initialize the change feed processor on all instances with the same processor name and the same instance name.
  3. C
    Initialize the change feed processor on all instances with a unique processor name for each instance.
  4. D
    Configure the lease container to use the monitored container's partition key path, and initialize all instances with the same processor name.

Answer

Initialize the change feed processor on all instances with the same processor name, but assign a unique instance name to each host.
To distribute the processing load across multiple instances, the change feed processor requires a shared logical identifier (the processor name) and a unique physical identifier (the instance name) for each host. The shared processor name groups the instances into a single deployment unit, allowing them to lease different partitions of the feed dynamically. The unique instance name prevents conflicts by ensuring that only one host owns a given partition lease at a time.

Step-by-Step Solution

1
Group instances into a single consumer group using a shared processor name.
The change feed processor recognizes all instances as part of the same logical deployment.
This prevents instances from acting as independent readers that duplicate the entire stream.
2
Assign a unique instance name to each host.
Each host is assigned a subset of partition leases without interfering with other hosts.
Unique instance names allow the change feed processor to allocate and track lease ownership correctly.
3
Ensure the lease container partition key is set to /id/id.
The lease container supports correct coordination of leases.
The Azure Cosmos DB SDK requires the lease container to be partitioned by /id/id.

Key Concept

Change Feed Processor Scale-out Configuration
Estimated Time:1m 30s
Rate this question