Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — Question 28

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?

Answer options

Correct answer: B

Explanation

Choosing the device ID as the partition key (option B) allows for even distribution of read and write operations across partitions, as each device will be represented by a unique ID. This setup minimizes the risk of hitting partition limits and facilitates quicker access to telemetry data specific to each device. The other options either introduce unnecessary complexity or do not effectively distribute the data across partitions.