Primary terminologies related to “Partition Key In Azure Cosmos DB”
Below are the key terminologies related to Partition Key in Azure Cosmos DB:
Partition Key
The partition key is a property defined by the user in a cosmos db container associated to each document stored. The partition key is composed of the partition key path and partition key value. As an example “/userid” is the path and a value “johndoe” related to the key ‘userid’ is the partition key value.
Logical Partitions
The data stored within a container are divided into logical groups based on the partition key values. Logical partitions enable to distribute data across multiple servers. All documents with same partition key value are stored in the same logical partitions.
Physical Partitions
The physical partitions are the underlying storage in cosmos db which holds one or more logical partitions for optimal storage and performance. The physical partition is fully managed by the Azure cloud services and not controlled by users.
Throughput
Throughput refers to the amount of resources allocated for handling operations like read, write, delete or query in a database, measured in Request Units per second or RUs. Throughput in azure cosmos db can be provisioned on a per-container basis or shared within multiple containers of a database.
Request Units (RUs)
Request units can be compared as currency for Cosmos DB resources. Every cosmos db operation like read, write, delete and query consume varying amount of RUs based on different factors like data size and query complexity.
What is Partition Key In Azure Cosmos DB
The Partition Key in Azure Cosmos DB is an important factor for distributing data efficiently across the database’s physical partitions. The partition key plays an important role in storing and accessing data and the partition key makes the filtering data more efficient and optimized. In this article we will discuss the partition key in Azure Cosmos DB, how it is created, and how it is used in data storage and data retrieval.
Contact Us