nerdexam
Microsoft

DP-420 · Question #177

You are designing an Azure Cosmos DB for NoSQL solution to store data from IoT devices. Writes from the devices will occur every second. Data will be retained indefinitely. The following is a sample…

The correct answer is B. Create a new synthetic key that contains deviceId and timestamp. When IoT devices write every second and data is retained indefinitely, each logical partition risks exceeding the 10 GB logical partition size limit over time if only deviceId is used (all data for one device accumulates in one partition, creating a hot partition and risking…

Design and implement data models

Question

You are designing an Azure Cosmos DB for NoSQL solution to store data from IoT devices. Writes from the devices will occur every second. Data will be retained indefinitely. The following is a sample of the data. You need to select a partition key that meets the following requirements for writes:

  • Minimizes the partition skew
  • Avoids capacity limits
  • Avoids hot partitions

What should you do?

Options

  • AUse deviceId as the partition key.
  • BCreate a new synthetic key that contains deviceId and timestamp.
  • CUse sensor1value as the partition key.
  • DCreate a new synthetic key that contains deviceId and sensor1Value.

How the community answered

(24 responses)
  • A
    4% (1)
  • B
    79% (19)
  • C
    13% (3)
  • D
    4% (1)

Explanation

When IoT devices write every second and data is retained indefinitely, each logical partition risks exceeding the 10 GB logical partition size limit over time if only deviceId is used (all data for one device accumulates in one partition, creating a hot partition and risking capacity limits). Using a synthetic key combining deviceId and timestamp creates high cardinality - each second of data for each device gets a unique partition key - distributing writes evenly across many partitions, preventing hot partitions, and keeping individual partition sizes manageable. Using sensor1value alone would create skew since sensor values cluster. Using deviceId + sensor1Value would still accumulate unbounded data per device.

Topics

#Partition Keys#Synthetic Keys#Hot Partitions#Time-Series Data

Community Discussion

No community discussion yet for this question.

Full DP-420 Practice