A physical partition is a bounded storage unit that holds database data on Azure infrastructure. It distributes data so workloads can scale without placing everything on one overloaded machine. section 11.3.2 section 5.6.2
In Cosmos DB, each physical partition has a size limit. When it fills, Cosmos DB can split it; as data and throughput change, the service can split or merge partitions transparently without downtime. A logical partition must fit inside one physical partition, making partition-key choice important. section 11.3.2
A useful partitioning plan considers:
- Even load: choose a partition key that avoids concentrating peak access on one partition. section 11.3.2
- Stable identity: use an immutable partition-key attribute because the key cannot be updated after selection. section 11.3.2
- Table Storage placement: the partition key indicates where an entity is stored, while the partition key plus row key identifies it across the table. section 5.6.2
A product catalog with balanced categories
Alpaca-Ma-Bags can partition a Cosmos DB product catalog by category when sales are spread evenly across categories. The Azure CLI command creates the collection with --shard "/category" and provisions 400 RU/s. section 11.3.2
