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?
- A.Read the change feed with a shorter polling interval.
- B.Use a pre-trigger because change feed entries are generated only by triggers.
- C.Replace physical deletion with an update that marks the document as deleted, and process that update from the change feed.Correct answer
- 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
- A .NET service must process new and updated documents from an Azure Cosmos DB container, while allowing multiple service instances to scale…
- A stored procedure in Azure Cosmos DB must insert three documents and update a fourth document as one atomic operation. What is required fo…
- An application has a Cosmos DB pre-trigger named ValidateOrder. The developer expects the trigger to run automatically whenever any client…
- A Cosmos DB container uses customerId as its partition key. A change feed consumer receives changes for customers C100 and C200. Which orde…
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 freeFree to start · No credit card needed