QuestionQ116

Design and implement data distribution

You are designing an Azure Cosmos DB for NoSQL solution to store data from IoT devices. The devices will write every second, and 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 deviceManufacturer as the partition key.
  • B Create a new synthetic key that contains deviceId and timestamp.
  • C Create a new synthetic key that contains deviceId and deviceManufacturer.
  • D Use deviceId as the partition key.
Explanation

A synthetic partition key that combines deviceId and timestamp has high cardinality and distributes continuous device writes across many logical partitions. The time component prevents indefinitely retained data for a device from accumulating under one partition-key value, avoiding the 20-GB logical-partition limit; the combined values also reduce skew and hot-partition risk. Microsoft documents this IoT pattern as a synthetic key combining device ID with a time-based key.

Learn more

Community Discussion

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