Courseiva

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

A mobile app stores user preferences as JSON documents in Azure Cosmos DB. The document includes userId, theme, language, and notification settings. The most common query retrieves the document for a specific userId. To minimize cost and ensure even distribution, which property should be chosen as the partition key?

⚠ Common exam trap

Candidates often choose a concatenated key (option D) thinking it adds uniqueness or query flexibility, but Azure Cosmos DB's partition key design favors a single high-cardinality attribute for even distribution and simple point reads.

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

userId

The userId property is the ideal partition key because it provides high cardinality (each user has a unique ID) and ensures even request distribution across physical partitions. Since the most common query retrieves a document by userId, using it as the partition key makes those queries point reads (single-partition queries), which are the most cost-efficient and fastest 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.

  • userId

    Why this is correct

    Using userId as the partition key is correct because it has high cardinality — each user has a unique ID, so every document maps to a distinct logical partition. This evenly spreads data across the physical partitions, preventing hot spots. It also makes point reads by userId highly efficient: the container can route directly to the partition containing that document, typically consuming a minimal number of Request Units (RUs) and delivering low-latency lookups.

  • theme

    Why it's wrong here

    Theme is a poor partition key because it has very low cardinality — typically only a few possible values like light, dark, or high-contrast. With only a handful of partitions, all users who choose the same theme land in the same partition, creating an extreme hot partition. That partition will receive a disproportionate share of requests, causing request throttling (429 errors), higher RU consumption, and degraded performance, while other partitions remain underutilized.

  • language

    Why it's wrong here

    Language also exhibits low cardinality — even globally, there are only dozens of common language codes, so each partition would store a huge number of documents. Because user preferences are likely queried by individual user rather than by language, this key offers no query benefit while causing skew: popular languages (e.g., en, es) become hot partitions that exceed throughput limits, leading to latency spikes and throttling for users in those partitions.

  • a concatenation of userId and language

    Why it's wrong here

    Concatenating userId and language, such as "user123-en", does improve cardinality because userId dominates the key and spreads data evenly. However, it introduces redundancy: language is already a field inside the document, so the composite key increases storage overhead, index size, and write RU costs without enhancing the main point-read query. Worse, a point read by userId alone becomes a cross-partition query, because the exact language must also be supplied to calculate the partition key, otherwise Azure Cosmos DB must fan out across all partitions and consume far more RUs.

About these practice questions

One of 820 original DP-900 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.