nerdexam
Microsoft

DP-420 · Question #182

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 A. Create a new synthetic key that contains deviceId and timestamp. This is the same core scenario as Question 7: devices writing every second with indefinite data retention. Using only timestamp would cause a single sequential hot partition (all devices writing at the current second compete for the same partition key). Using sensor1Value alone…

Design and implement data distribution

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

  • ACreate a new synthetic key that contains deviceId and timestamp.
  • BUse timestamp as the partition key.
  • CUse sensor1Value as the partition key.
  • DCreate a new synthetic key that contains deviceId and deviceManufacturer.

How the community answered

(17 responses)
  • A
    76% (13)
  • B
    6% (1)
  • C
    6% (1)
  • D
    12% (2)

Explanation

This is the same core scenario as Question 7: devices writing every second with indefinite data retention. Using only timestamp would cause a single sequential hot partition (all devices writing at the current second compete for the same partition key). Using sensor1Value alone would create skew since sensor readings cluster around certain values. Using deviceId + deviceManufacturer would fail because manufacturer is low-cardinality (few unique values) and provides no time-based distribution, leading to unbounded partition growth. A synthetic key of deviceId + timestamp creates high cardinality across both the device dimension and time dimension, evenly distributing writes and preventing any single partition from growing unbounded.

Topics

#Partition key design#Hot partitions#Partition skew#IoT solution design

Community Discussion

No community discussion yet for this question.

Full DP-420 Practice