Partitioning
Cosmos makes use of two types of partitions – namely physical and logical partitions – in order to scale individual containers (that is, collections) in a database. The partition key that's defined at the time of the creation of a container defines the logical partitions. These logical partitions are then distributed into groups to physical partitions with a set of replicas to be able to horizontally scale the database.
In this scheme, the selection of the partition key becomes an important decision that will determine the performance of your queries. With a properly selected partition key, the data would be sharded (that is, data sharding) uniformly so that the distributed system will not show so-called hot partitions (that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access