Whenever permitting rules documents change in Cosmos DB, a search projection used by the city permits assistant must refresh. Which approach fits?
Select an answer to reveal the explanation.
Short Explanation
Change feed is the permits desk’s ticker tape—when a rules document moves, the processor updates the search projection without waiting for a monthly scavenger hunt.
Full Explanation
A Cosmos DB change feed processor is the appropriate municipal pattern when a search projection must stay aligned with permitting-rules documents as they change. The change feed exposes inserts and updates from the container so a processor can incrementally refresh the permits assistant’s search index or projection without waiting for coarse batch jobs. That keeps resident-facing permit guidance consistent with the latest rules stored in Cosmos while controlling operational cost.
Polling a random sample of containers once a month and ignoring document change events fails freshness and correctness: random sampling can miss critical rule updates for weeks. Deleting the entire search index nightly whether or not any rules changed is wasteful, causes unnecessary rebuild windows, and risks prolonged outages of the permits assistant. Requiring residents to email IT when they notice outdated guidance shifts detection to end users and is not an Azure data-plane integration pattern.
Exam caveat: change feed is at-least-once delivery semantics in typical processor designs—handlers must be idempotent when updating search projections so duplicate notifications do not corrupt municipal indexes. Operational check: deploy a change feed processor with a leased processor state, emit metrics for lag (time from Cosmos write to projection update), verify that a controlled rules-document edit appears in the search projection within the city’s SLA, and alert when lag exceeds that threshold.