Azure Cosmos DB – Change Feed, Stored Procedures and Triggers · AZ-204: Developing Solutions for Microsoft Azure Develop for Azure Storage

An application uses the default latest-version mode of the Azure Cosmos DB change feed. It must reliably notify another system when a customer docume…

Practice question from Azure Cosmos DB – Change Feed, Stored Procedures and Triggers (AZ-204: Developing Solutions for Microsoft Azure Develop for Azure Storage), with the correct answer and a step-by-step solution.

medium · MCQ · Q-42686E

An application uses the default latest-version mode of the Azure Cosmos DB change feed. It must reliably notify another system when a customer document is deleted, but it cannot change the delete operation to use a separate notification API. What is the most reliable design?

  1. A.Read the change feed with a shorter polling interval.
  2. B.Use a pre-trigger because change feed entries are generated only by triggers.
  3. C.Replace physical deletion with an update that marks the document as deleted, and process that update from the change feed.Correct answer
  4. D.Read the change feed from the beginning after every delete operation.

Solution

In the default latest-version mode, the change feed records created and updated versions but does not expose ordinary deletes. A soft-delete update, such as setting isDeleted to true, produces a change-feed entry that the consumer can process.

More from Azure Cosmos DB – Change Feed, Stored Procedures and Triggers

All of Azure Cosmos DB – Change Feed, Stored Procedures and Triggers

Practise more Develop for Azure Storage

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed