Courseiva

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

A mobile game company stores player scores in Azure Cosmos DB. Each document contains the fields PlayerID (unique to the player), GameID, Score, and Timestamp. The most common query is: 'Retrieve all scores for a specific GameID, ordered by Score descending.' Which property should be chosen as the partition key to minimize Request Unit (RU) consumption?

⚠ Common exam trap

Many exam-takers choose PlayerID because it is unique and seems like a natural key, but they overlook that a partition key must align with the most common query filter to avoid cross-partition queries and high RU costs.

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

GameID

GameID is the correct partition key because the most common query filters on GameID, and using it as the partition key ensures that all documents for a given GameID are stored in the same physical partition. This allows the query to target a single partition, minimizing cross-partition fan-out and reducing Request Unit (RU) consumption. A partition key that matches the query filter is essential for efficient, low-latency reads 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.

  • PlayerID

    Why it's wrong here

    PlayerID would distribute documents evenly because every player is unique, but the application's most common query filters by GameID, not player. With PlayerID as the partition key, each query for a given game would have to fan out across all partitions to find that game's scores, increasing request unit (RU) consumption and latency. This misalignment between partition key and access pattern is the key reason it's a poor choice here.

  • GameID

    Why this is correct

    GameID is the filter in the dominant query, so it is the natural partition key. Cosmos DB places all items with the same GameID in the same logical partition, allowing a query such as 'SELECT * FROM scores s WHERE s.GameID = @gameId' to target a single partition and complete efficiently. Provided the number of games is large enough to avoid a single game exceeding the 10 GB logical partition limit, GameID gives good distribution and aligns perfectly with the workload.

  • Score

    Why it's wrong here

    Score is not used as a filter in the common query, and it has low cardinality because many players can have identical scores, leading to skewed logical partitions that may approach the 10 GB maximum. Using Score as a partition key would create very few large partitions rather than many evenly sized ones, and those large partitions would become hot spots for writes and reads. A partition key must be a property that appears in your most frequent query predicate, and Score fails that requirement.

  • Timestamp

    Why it's wrong here

    Timestamp has extremely high cardinality, which is often good for distribution, but it is not part of the application's most common query predicate. If Timestamp were the partition key, every score would land on its own partition (or a very small time slice), so a GameID query would need to touch every partition to aggregate scores for that game, dramatically increasing RU cost and latency. Timestamp would only be appropriate if time-based range queries across all games were the primary access pattern.

About these practice questions

Courseiva writes every DP-900 question from scratch — 820 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.