DP-420 · Question #63
Which of the following is the most optimal method of managing referential integrity between different containers in Azure Cosmos DB?
The correct answer is B. Using an Azure Function trigger for Azure Cosmos DB to leverage on the change feed processor. The change feed APIs help in keeping the track of all the Insert and Updates on a container, creating a trigger depending upon the change feed, will allow the users to send those changes to other containers that also require those changes. Option A is incorrect. Azure Cosmos DB…
Question
Which of the following is the most optimal method of managing referential integrity between different containers in Azure Cosmos DB?
Options
- ACreating an Azure Cosmos DB Function that will periodically search for changes done to your
- BUsing an Azure Function trigger for Azure Cosmos DB to leverage on the change feed processor
- CWhen any changes are created by your app to one container, also ensure it duplicates the
- DAll are equally efficient
How the community answered
(67 responses)- A7% (5)
- B73% (49)
- C4% (3)
- D15% (10)
Explanation
The change feed APIs help in keeping the track of all the Insert and Updates on a container, creating a trigger depending upon the change feed, will allow the users to send those changes to other containers that also require those changes. Option A is incorrect. Azure Cosmos DB functions don’t modify data and their scope is limited only within the container they are defined in. Option B is correct. Using an Azure Function trigger for Azure Cosmos DB to leverage the change feed processor to update the referenced containers is the most optimal way to manage referential integrity between different containers in Azure Cosmos DB. Option C is incorrect. While it can be possible to add this logic to your app, adding the code to the application won’t add complexity to your environment, but also it won’t guarantee that any changes carried out outside of the app would be replicated to the other containers. Option D is incorrect. Using an Azure Function trigger for Azure Cosmos DB to leverage the change feed processor to update the referenced containers is the most optimal method. https://docs.microsoft.com/en-us/learn/modules/advanced-modeling-patterns-azure-cosmos-db/4- manage-referential-integrity-with-change-feed
Topics
Community Discussion
No community discussion yet for this question.