Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Differentiate between change feed processor and pull mode models

A worked example

Single answer

Contoso's productMeta container is partitioned on /type and holds both category and tag documents. The team writes all of its services in Python and is designing a consumer for category changes.

Requirements:

  1. The consumer must request from the feed only the changes for the partition key value category, rather than reading every change and filtering in code.
  2. After a host restart, it must resume from its last processed position instead of starting over.
  3. If the host crashes partway through a page, the changes in that page must be processed again rather than skipped.

Which consumer design meets all the requirements?

Choose one answer
Why

Reading the feed for a single partition key value is something only the pull model offers; the processor, and the Azure Functions trigger that runs it, read the whole container. Because the pull model has no lease container, the application must persist its continuation token itself to resume after a restart. That token must be saved only after every item in the page is processed so that a crash replays the page instead of skipping it.

  • Not correct: A pull-model loop with partition_key="category" that keeps the latest continuation token in a variable in process memory. A pull-model reader tracks position only through the continuation token it stores itself; a token held only in memory is lost when the host restarts.
  • Not correct: An Azure Functions trigger in the Python v2 model with a lease container, skipping items whose type is not category. The trigger runs the change feed processor, which does not support reading a single partition key value, so it receives all changes and the filter runs in code.
  • Correct: A pull-model loop with partition_key="category" that saves each page's continuation token durably after processing every item in it. The pull model supports reading one partition key value, a durably stored continuation token lets it resume after a restart, and saving the token after processing means a crash replays the page.
  • Not correct: A pull-model loop with partition_key="category" that saves each page's continuation token durably before processing the items in it. The token must be persisted after the batch is processed, never before; saving it first means a crash mid-page resumes past the unprocessed changes and skips them.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free