DP-420 · Question #181
You plan to implement an Azure Cosmos DB container that will store telemetry data from 1,000 IoT devices. The data will be updated once every minute. An app will read the data once daily and…
The correct answer is B. the device ID. With 1,000 IoT devices each writing once per minute, using the device ID as the partition key distributes writes evenly across 1,000 distinct logical partitions. Since writes occur only once per minute per device (far less frequently than Question 7's every-second scenario)…
Question
You plan to implement an Azure Cosmos DB container that will store telemetry data from 1,000 IoT devices. The data will be updated once every minute. An app will read the data once daily and generate aggregated reports that summarize the state of each device. You need to configure a partition key for the container. The solution must meet the following requirements:
- Minimize the possibility of reaching the partition limits.
- Spread read and write operations evenly across the partitions.
- Minimize how long it takes to locate a specific set of telemetry
values. To what should you set the partition key?
Options
- Athe device ID and date
- Bthe device ID
- Cthe date and a random value
- Dthe date
How the community answered
(50 responses)- A4% (2)
- B84% (42)
- C10% (5)
- D2% (1)
Explanation
With 1,000 IoT devices each writing once per minute, using the device ID as the partition key distributes writes evenly across 1,000 distinct logical partitions. Since writes occur only once per minute per device (far less frequently than Question 7's every-second scenario), the data volume per device partition remains manageable and unlikely to hit the 10 GB limit. Using device ID also minimizes read latency for locating specific device telemetry because all data for a device lives in the same partition. Using date alone would create a severe hot partition (all devices writing to today's partition). A random value would destroy read efficiency since you couldn't target a device's data.
Topics
Community Discussion
No community discussion yet for this question.