You are designing an Azure Cosmos DB container to store telemetry data from millions of IoT devices. The workload has a high-write throughput profile ( writes per second) and reads are scoped to individual devices. You need to ensure that transactions are restricted to a single device's data, and that storage and Request Units (RUs) are distributed evenly to avoid hot partitions. Which property should you select as the partition key?
- Astatus
- BfactoryLocation
- deviceIdCevap
- DdeviceType
Cevap
The deviceId property should be selected as the partition key.
The correct partition key is the device identifier. Selecting a partition key with high cardinality, such as the device identifier, ensures that storage and request throughput are distributed evenly across logical and physical partitions. Since transactions are restricted to a single device's data, grouping by the device identifier satisfies the transactional scope.
Adım Adım Çözüm
Anahtar Kavram
Partition key selection in Azure Cosmos DB requires choosing a property with high cardinality to distribute throughput and storage evenly, while aligning with the query patterns and transactional boundaries of the application.