DP-420 · Question #175
You are designing an Azure Cosmos DB for NoSQL solution to store data from IoT devices. Writes from the devices will occur every second. Data will be retained indefinitely. The following is a sample…
The correct answer is D. Create a new synthetic key that contains deviceId and a random number. Creating a synthetic key that combines deviceId with a random number helps distribute writes more evenly across partitions, effectively minimizing partition skew and avoiding hot partitions. This approach also helps to maintain a balance of write operations, ensuring that no…
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. Data will be retained indefinitely. The following is a sample of the data. 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?
Exhibit
Options
- AUse deviceId as the partition key.
- BCreate a new Synthetic key that contains deviceId and deviceManufacturer.
- CUse deviceManufacturer as the partition key.
- DCreate a new synthetic key that contains deviceId and a random number.
How the community answered
(64 responses)- A14% (9)
- B6% (4)
- C3% (2)
- D77% (49)
Explanation
Creating a synthetic key that combines deviceId with a random number helps distribute writes more evenly across partitions, effectively minimizing partition skew and avoiding hot partitions. This approach also helps to maintain a balance of write operations, ensuring that no single partition is overwhelmed, which can occur if using deviceId alone, especially if devices write data
Topics
Community Discussion
No community discussion yet for this question.
