Microsoft

DP-420 practice question 6

Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB · free question 6 of 20

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. A sample of the data is shown in the exhibit. 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?
Sample IoT document: id, deviceManufacturer, deviceId, timestamp, sensor1Value true, sensor2-5 values
  • A. Use timestamp as the partition key.
  • B. Create a new synthetic key that contains deviceId and sensor1Value.
  • C. Create a new synthetic key that contains deviceId and deviceManufacturer.
  • D. Create a new synthetic key that contains deviceId and a random number. Correct

Explanation

Appending a random suffix to deviceId spreads each device's continuous writes across several logical partitions, which removes hot partitions, keeps partitions evenly sized and stops any one device from reaching the 20 GB logical partition limit. Timestamp concentrates all current writes on one value at a time, creating a hot partition. sensor1Value is a Boolean, so deviceId plus sensor1Value adds at most two values per device, and deviceManufacturer adds nothing because each device has only one manufacturer, so both still leave every device's writes in one or two partitions.

Need the theory? Learn it free in the DP-420 course on Godlike Academy

Practice the whole free set

Answer all 20 free DP-420 questions with instant feedback, or unlock all 211 questions with Learn and Exam modes.