Courseiva

DP-900 Practice Question: Describe considerations for working with non-relational data on Azure

A social media company stores user posts in Azure Cosmos DB. Each post document contains fields like postId, userId, content, timestamp, and an array of comments. The comments array can grow large (hundreds per post), and the application frequently retrieves a post without its comments to display in a feed. To optimize read performance and minimize request units (RU) consumption, which data modeling approach should the company adopt?

⚠ Common exam trap

Watch out — candidates often think embedding the comments array is always optimal for performance, but they overlook that reading the entire document with a large array wastes RUs when only the post metadata is needed, making reference-based modeling more efficient for this access pattern.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

B. Store comments as separate documents and reference them from the post document via a comments array of IDs.

Storing comments as separate documents and referencing them via an array of IDs in the post document allows the application to retrieve the post without comments in a single point read, consuming minimal request units (RUs). This avoids loading the large comments array when only the post metadata is needed for the feed, significantly reducing RU consumption and improving read performance in Azure Cosmos DB.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • A. Store comments in a separate container to isolate the data.

    Why it's wrong here

    Storing comments in a separate container fails this scenario because it necessitates a join operation across containers when a post *with* its comments is required, which is inefficient and costly in Cosmos DB. While it would make the post document smaller for feed display, the primary issue is the lack of native join capabilities for distributed data. This approach is tempting for relational database users, as it isolates data and reduces the size of the main entity. It would be a correct choice if comments were rarely accessed *with* the post, or if they had vastly different access patterns and required separate scaling or partitioning strategies.

  • B. Store comments as separate documents and reference them from the post document via a comments array of IDs.

    Why this is correct

    This approach decouples comments from the post document. When retrieving a post for the feed, the application reads only the post document, avoiding the large comments array. This reduces RU consumption and improves latency. Comments can be loaded on demand when needed.

  • C. Use a vertical partition within the same document to separate the comments array.

    Why it's wrong here

    Vertical partitioning within a document is not a concept in NoSQL databases like Cosmos DB. Documents are stored as a single JSON object; there is no way to selectively retrieve parts of a document without reading the entire thing.

  • D. Migrate the data to Azure SQL Database to use normalized tables and indexes.

    Why it's wrong here

    Migrating to a different database platform is not a data modeling optimization for Cosmos DB. The scenario explicitly involves Cosmos DB, and the best practice is to model the data appropriately within the same service.

About these practice questions

This DP-900 question is part of Courseiva's 820-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DP-900 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-900 exam.