Azure Cosmos DB Scalability

Understanding Scalability in Cosmos DB

Cosmos DB offers different scalability options to meet your application's demands. It's designed to handle varying workloads, from small applications to large-scale enterprise solutions.

Cosmos DB scales horizontally, meaning you can add more resources to your database without disrupting your application. This is achieved through:

Scaling Options

Cosmos DB provides several ways to scale your database:

  1. Manual Scaling: You can manually increase or decrease your RU/s allocation.
  2. Automatic Scaling (Throughput Autoscale): Cosmos DB automatically adjusts your RU/s based on your application's consumption patterns.
  3. Resource Tiering: Choose from different performance tiers (e.g., Basic, General Purpose, Memory Optimized) to optimize performance and cost.

Example: Configuring Throughput Autoscale

Let's illustrate how to configure throughput autoscale.

                        {
                            "setScaling": {
                                "minThroughput": 500,
                                "maxThroughput": 2000,
                                "stepSize": 50
                            }
                        }
                    

This example sets a minimum throughput of 500 RU/s and a maximum of 2000 RU/s with a step size of 50 RU/s.