Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — Question 29

You have an Azure subscription.

You plan to create an Azure Cosmos DB for NoSQL database named DB1 that will store author and book data for authors that have each published up to ten books. Typical and frequent queries of the data will include:

• All books written by an individual author
• The synopsis of individual books

You need to recommend a data model for DB1. The solution must meet the following requirements:

• Support transactional updates of the author and book data.
• Minimize read operation costs.

What should you recommend?

Answer options

Correct answer: D

Explanation

The correct answer is D because embedding a list of each author's books within the corresponding author item allows for efficient transactional updates and minimizes read operation costs by keeping related data together. Options A and B introduce unnecessary complexity by separating data across multiple containers, which can increase read costs and complicate transactions. Option C, while it does embed data, uses two containers, which doesn't optimize for read operation costs as effectively as option D.