Azure Cosmos DB is a powerful NoSQL database offering in the Azure data stack. While the default capacity mode is provisioned throughput, there are scenarios where a fixed capacity instance may not be efficient in terms of scale and cost. In such cases, a serverless instance of Azure Cosmos DB can be a more suitable option.
Creating a Serverless Instance
To create a serverless instance of Azure Cosmos DB, follow these steps:
- Log in to the Azure portal and open the Cosmos DB service option.
- Click on the “New” button to start creating a new Cosmos DB account.
- Provide the basic details such as the name of the subscription and the resource group.
- In the instance details section, provide the name of the account, which will be the name of the instance.
- Select the Core (SQL) API for creating the account.
- Choose the region where the account is to be created.
- In the Capacity mode, select the “Serverless” option.
- Configure other settings as required, such as the account type and networking details.
- Review all the configuration details and click on the “Create” button to start the creation process.
Once the account is created, you can navigate to the dashboard page to explore and operate through different details of the Azure Cosmos DB account.
Benefits of Serverless Instance
A serverless instance of Azure Cosmos DB offers several benefits:
- On-demand scaling: The capacity of the instance scales automatically based on the workload, eliminating the need for fixed capacity provisioning.
- Cost optimization: With serverless, you only pay for the resources you consume, making it more cost-effective for workloads with variable traffic.
- Easy management: Serverless instances require less administrative effort as the scaling is handled automatically.
Limitations of Serverless Instance
While serverless instances provide flexibility and cost savings, there are some limitations to consider:
- Capacity limitations: Serverless instances can scale up to 5000 RUs and have a maximum storage of 50 GB. If your workload requires more capacity, a provisioned capacity model may be more suitable.
- Optimal for non-critical workloads: Serverless instances are ideal for small to medium non-critical workloads with light traffic. For critical workloads or high-traffic applications, provisioned capacity is recommended.
Conclusion
In this article, we learned how to create a serverless instance of Azure Cosmos DB. We explored the benefits and limitations of using a serverless model and discussed the scenarios where it can be applied effectively. By leveraging the serverless option, you can optimize costs and scale your workloads efficiently in Azure Cosmos DB.