A sports platform manages live match telemetry. Each match has a unique matchId. The platform stores match events (such as goals, penalties, and player substitutions) as separate documents in an Azure Cosmos DB for NoSQL container.
The application must meet the following requirements:
- Guarantee ACID compliance when executing updates on multiple event documents belonging to the same match using transactional batches.
- Avoid hot partitions during peak hours when many live matches are played simultaneously.
- Maintain high write throughput to handle real-time event ingestion.
Which property should you configure as the partition key for the container?
- matchIdCevap
- BeventId
- CtournamentId
- DsportType
Cevap
matchId
Configuring matchId as the partition key meets all requirements. Because Azure Cosmos DB transactional batches are scoped to a single logical partition, using matchId ensures that all events for a given match reside in the same logical partition, allowing transaction execution. Furthermore, because there are many concurrent matches, matchId provides high cardinality, which distributes write throughput (RUs) and storage requirements evenly across physical partitions, avoiding the hot partition problem.
Adım Adım Çözüm
Anahtar Kavram
Azure Cosmos DB logical partitions serve as the boundary for both scalability (distribution) and transactions (ACID transactional batches).