QuestionQ126

Design and implement data distribution

You are designing an Azure Cosmos DB for NoSQL solution to store data from IoT devices. Devices will write every second, and the data will be retained indefinitely.

The following is a sample of the data.

Question Image

You need to choose a partition key that meets these write requirements:

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

What should you do?

  • A Use deviceId as the partition key.
  • B Create a new synthetic key that contains deviceId and timestamp.
  • C Use sensor1value as the partition key.
  • D Create a new synthetic key that contains deviceId and sensor1Value.
Explanation

A synthetic partition key composed of deviceId and timestamp has high cardinality because each device produces new timestamped values continually. It spreads writes and retained data across logical partitions, reducing skew and hot-partition risk while preventing one indefinitely growing device partition from reaching the 20-GB logical-partition limit. Microsoft recommends a synthetic key combining an identifier and date for higher cardinality and better distribution in IoT-style workloads.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!