You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Cosmos DB achieves elastic scale through automatic partitioning and measures all operations in Request Units (RUs). Understanding how partitioning works and how RU consumption is calculated is essential for building performant, cost-effective applications.
A logical partition is a set of items that share the same partition key value. For example, in an e-commerce container with partition key /customerId:
Logical Partition "c001": [Order-1, Order-2, Order-3]
Logical Partition "c002": [Order-4, Order-5]
Logical Partition "c003": [Order-6, Order-7, Order-8, Order-9]
| Constraint | Limit |
|---|---|
| Max logical partition size | 20 GB |
| Max item size | 2 MB (NoSQL API) |
Cosmos DB automatically maps logical partitions to physical partitions — the actual compute and storage resources:
Physical Partition 1: [c001, c002] — 30 GB, 3000 RU/s
Physical Partition 2: [c003, c004] — 25 GB, 3000 RU/s
Physical Partition 3: [c005, c006] — 20 GB, 3000 RU/s
| Constraint | Limit |
|---|---|
| Max physical partition size | 50 GB |
| Max physical partition throughput | 10,000 RU/s |
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.