Container

From Ilianko

← Back to DP-420 Terminology Reference

Category: Core Concepts

Summary: Fundamental unit of scalability/storage in Cosmos DB for NoSQL, analogous to a table.

Overview

A container is the fundamental unit of scalability and storage in Azure Cosmos DB for NoSQL, analogous to a table in a relational database. Containers are automatically partitioned across physical partitions based on a partition key, and provisioned throughput (or serverless consumption) is typically configured at the container level, although database-level throughput sharing across multiple containers is also possible.

az cosmosdb sql container create \
    --resource-group "" \
    --account-name "" \
    --database-name "" \
    --name "" \
    --partition-key-path "/" \
    --throughput 400
ContainerProperties
 ├─ PartitionKeyPath
 ├─ IndexingPolicy
 ├─ DefaultTimeToLive
 ├─ UniqueKeyPolicy
 └─ ConflictResolutionPolicy
ContainerProperties containerProperties = new()
{
    Id = "products",
    PartitionKeyPath = "/category",
    IndexingPolicy = new IndexingPolicy
    {
        IndexingMode = IndexingMode.Consistent,
        Automatic = true
    }
};

More Info & Links

DP-420 Style Practice Questions

Q1. What is the primary unit of scalability in Azure Cosmos DB for NoSQL?

  • A. Container
  • B. Database account
  • C. Region
  • D. Stored procedure

Q2. Where can throughput typically be provisioned in Azure Cosmos DB?

  • A. At the container level or shared at the database level
  • B. Only at the subscription level
  • C. Only at the item level
  • D. Only at the region level

Answer Key

Answers are listed at the very end so you can attempt the questions first.

  • Q1 (Container): A. Container — Containers are the unit of scalability; they are automatically partitioned and can have throughput provisioned independently.
  • Q2 (Container): A. At the container level or shared at the database level — Throughput can be provisioned at either the container level or shared across containers at the database level.

DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — term detail page