Courseiva

DP-203 Design and implement data storage Practice Question

A logistics company needs to store shipment tracking events in Azure Cosmos DB. Events are written continuously throughout the day, and the most common query pattern retrieves all events for a specific shipment ID ordered by timestamp. The workload is write-heavy and must scale horizontally across partitions. Which partition key should you choose?

⚠ Common exam trap

The trap here is choosing a high-cardinality key purely for write distribution without checking whether it matches the most frequent query filter.

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

✓

Use the shipment ID as the partition key.

The partition key should align with the dominant query pattern while distributing writes. Using shipment ID places all events for a shipment in the same logical partition, so the common query executes as a single-partition operation, and the high cardinality of shipment IDs spreads write traffic across physical partitions. Timestamp, event type, or random synthetic keys either cause cross-partition fan-out or create hot partitions.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Use the shipment ID as the partition key.

    Why this is correct

    Shipment ID distributes writes across partitions while co-locating all events for a given shipment in one logical partition. The common query for a shipment's events ordered by timestamp becomes a single-partition query, which is efficient and cheap in request units.

  • ✗

    Use the event timestamp as the partition key.

    Why it's wrong here

    Partitioning by timestamp spreads writes across many partitions, but the dominant query filters by shipment ID, so each query would fan out across every partition. That cross-partition fan-out increases latency and request unit consumption, making it a poor fit for the read pattern.

  • ✗

    Use the event type as the partition key.

    Why it's wrong here

    Event type has low cardinality and uneven distribution, so a few high-volume types would create hot partitions while most partitions stay idle. It also does not align with the shipment-based query, forcing cross-partition reads for the most frequent access pattern.

  • ✗

    Use a synthetic key formed by concatenating the event timestamp and a random GUID.

    Why it's wrong here

    A random synthetic key maximizes write distribution but destroys data locality, so retrieving all events for a shipment requires a cross-partition query against every partition. It solves write hot spots that do not exist here while making the primary read pattern expensive.

About these practice questions

This DP-203 question is part of Courseiva's 509-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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

This DP-203 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-203 exam.