Cosmos DB service tiers – Creating Scalable and Secure Databases

Technically speaking, Cosmos DB does not have service tiers; all options are classed as a Premium offering, as this is a multi-model and globally distributed database service that is designed to horizontally scale and replicate your data to any number of Azure regions.

High availability and low latency make Cosmos DB most suitable for mobile applications, games, and applications that need to be globally distributed.

Cosmos DB does provide two pricing models, however—Provisioned and Serverless, and the key to understanding these models is to first understand how operations are charged in general.

Unlike Azure SQL, which can be billed on a vCore basis, Cosmos DB billing is based on a Request Unit, or RU for short. 1 RU is equivalent to performing an action such as a read operation on a 1 kilobyte (KB) item. Other operations, such as reading, writing, and querying, are also assigned a relative number of RUs based on the complexity and size of the operations.

Based on the preceding information, the size of the record you are working with has a direct impact on the number of RUs an operation consumes, as well as other factors such as the following:

  • Indexing: Indexes on items would cost RUs, therefore if you chose not to index items, you would consume fewer RUs.
  • Property count: The more properties your items have, the greater the cost.
  • Data consistency: Cosmos DB offers different levels of data consistency, which is the time it takes for replicated data to be copied between one region and another. The highest levels of consistency, strong and bounded staleness, which ensures data is replicated as soon as possible, costs the most in terms of RUs.
  • Query complexity: Complex queries cost more; simple queries cost less.

Now that we have an understanding of what an RU is, we can better understand the options between the two provisioning models.


Tags:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *