Several instances of a worker service read the change feed of a Cosmos DB container. After a restart, each instance must resume from where the group left off, and the instances must divide the partitions among themselves. Where is that coordination state kept?
Show answer and explanation
Answer: D
The change feed processor library stores its continuation tokens and lease ownership in a separate lease container. Each instance acquires and renews leases for partition ranges, which lets the group balance work and resume after failures. The source container holds only the data, and no external cache is required for this coordination.
Why the other options are wrong
- A. Items in the source container hold application data and do not carry feed progress or lease ownership, so storing coordination state there would not be how the processor works.
- B. An in-memory dictionary is lost when the process restarts and cannot be shared across instances, so it would not allow resumption or partition sharing across the group.
- C. The change feed processor does not use an external cache for its state. Introducing one would add a dependency the library does not need and would not provide its lease semantics.