Microsoft Azure (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
How does Cosmos DB partition data and handle Request Units (RU/s)?
senior LevelazureAdvanced Internals
In Simple Words:
- Request Units (RUs): Universal currency for database throughput. 1 RU = Reading 1 item of 1 KB via self-link or ID.
- Partition Key Selection: Crucial for scalability. Cosmos DB hashes the partition key to distribute data across physical SSD partitions (max 50 GB per physical partition).
- Anti-Pattern: Low-cardinality partition keys create hot partitions where one physical partition exceeds its allocated RU limit and throws HTTP 429 ("Request rate too large") while others sit idle.