Question 903 of 997
Develop for Azure storagehardMultiple ChoiceObjective-mapped

AZ-204 Practice Question: Cosmos DB change feed processor for scalable…

This AZ-204 practice question tests your understanding of develop for azure storage. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. A key principle to apply: cosmos DB change feed. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

An e-commerce platform writes orders to a Cosmos DB container. A downstream inventory service must process every new or updated order exactly once, even if the inventory service restarts mid-batch. The solution must scale horizontally when order volume increases. What is the recommended design?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use the change feed processor library with a dedicated lease container; each worker instance claims partition leases and commits checkpoints after processing each batch

The change feed processor library with a dedicated lease container is the recommended design because it provides exactly-once processing semantics through checkpointing, automatic partition lease management for horizontal scaling, and resilience to worker restarts by resuming from the last committed checkpoint. This pattern is purpose-built for Cosmos DB change feed consumption in distributed systems.

Key principle: Cosmos DB change feed

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use the change feed processor library with a dedicated lease container; each worker instance claims partition leases and commits checkpoints after processing each batch

    Why this is correct

    The lease container stores the last-processed continuation token per partition. On restart, a worker reads its leases and resumes from the checkpointed position. Adding more worker instances automatically redistributes leases across instances, providing linear horizontal scaling.

    Related concept

    Cosmos DB change feed

  • Poll the Cosmos DB container every 30 seconds using a _ts timestamp filter to find recently modified documents

    Why it's wrong here

    Timestamp polling has two problems: clock skew can cause missed documents near the query boundary, and repeated full-container scans increase RU consumption. The change feed is a purpose-built, push-based stream that avoids both issues.

  • Subscribe to Azure Event Grid Cosmos DB events and process them in an Azure Function

    Why it's wrong here

    Azure Event Grid does not natively emit per-document Cosmos DB change events at the document level in a way that supports the exactly-once-with-checkpoint semantics required. The change feed processor is the supported pattern for this use case.

  • Enable Cosmos DB analytical store and run batch queries from an Azure Synapse Spark pool every hour

    Why it's wrong here

    The analytical store serves OLAP workloads with high latency (minutes to hours). The inventory service needs near-real-time processing after each order write. Spark batch queries are unsuitable for event-driven, low-latency inventory updates.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may choose Event Grid (Option C) because it is event-driven and seems simpler, but they overlook that Event Grid does not provide exactly-once processing or checkpoint-based restart resilience for Cosmos DB change feed scenarios.

Detailed technical explanation

How to think about this question

The change feed processor library works by having each worker instance acquire leases on partitions stored in a separate lease container; after processing a batch, the worker commits a checkpoint (the continuation token) to the lease container. If a worker restarts, it reads the last checkpoint and resumes from that point, ensuring no duplicates. The library also automatically redistributes leases when workers are added or removed, enabling seamless horizontal scaling.

KKey Concepts to Remember

  • Cosmos DB change feed
  • change feed processor
  • lease container
  • at-least-once delivery
  • horizontal scaling

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Cosmos DB change feed

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Review cosmos DB change feed, then practise related AZ-204 questions on the same topic to reinforce the concept.

Related practice questions

Related AZ-204 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free AZ-204 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this AZ-204 question test?

Develop for Azure storage — This question tests Develop for Azure storage — Cosmos DB change feed.

What is the correct answer to this question?

The correct answer is: Use the change feed processor library with a dedicated lease container; each worker instance claims partition leases and commits checkpoints after processing each batch — The change feed processor library with a dedicated lease container is the recommended design because it provides exactly-once processing semantics through checkpointing, automatic partition lease management for horizontal scaling, and resilience to worker restarts by resuming from the last committed checkpoint. This pattern is purpose-built for Cosmos DB change feed consumption in distributed systems.

What should I do if I get this AZ-204 question wrong?

Review cosmos DB change feed, then practise related AZ-204 questions on the same topic to reinforce the concept.

What is the key concept behind this question?

Cosmos DB change feed

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More AZ-204 practice questions

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.