Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 3.67 KB

how-to-provision-database-throughput.md

File metadata and controls

79 lines (56 loc) · 3.67 KB
title description author ms.service ms.subservice ms.topic ms.date ms.author ms.reviewer ms.custom
Provision database throughput in Azure Cosmos DB for NoSQL
Learn how to provision throughput at the database level in Azure Cosmos DB for NoSQL using Azure portal, CLI, PowerShell and various other SDKs.
seesharprun
cosmos-db
nosql
how-to
10/15/2020
sidandrews
mjbrown
devx-track-azurecli, devx-track-csharp, devx-track-dotnet

Provision standard (manual) throughput on a database in Azure Cosmos DB - API for NoSQL

[!INCLUDENoSQL]

This article explains how to provision standard (manual) throughput on a database in Azure Cosmos DB for NoSQL. You can provision throughput for a single container, or for a database and share the throughput among the containers within it. To learn when to use container level and database level throughput, see the Use cases for provisioning throughput on containers and databases article. You can provision database level throughput by using the Azure portal or Azure Cosmos DB SDKs.

If you are using a different API, see API for MongoDB, API for Cassandra, API for Gremlin articles to provision the throughput.

Provision throughput using Azure portal

  1. Sign in to the Azure portal.

  2. Create a new Azure Cosmos DB account, or select an existing Azure Cosmos DB account.

  3. Open the Data Explorer pane, and select New Database. Provide the following details:

    • Enter a database ID.
    • Select the Share throughput across containers option.
    • Select Autoscale or Manual throughput and enter the required Database throughput (for example, 1000 RU/s).
    • Enter a name for your container under Container ID
    • Enter a Partition key
    • Select OK.

    :::image type="content" source="../media/how-to-provision-database-throughput/provision-database-throughput-portal-sql-api.png" alt-text="Screenshot of New Database dialog box":::

Provision throughput using Azure CLI or PowerShell

To create a database with shared throughput see,

Provision throughput using .NET SDK

Note

You can use Azure Cosmos DB SDKs for API for NoSQL to provision throughput for all APIs. You can optionally use the following example for API for Cassandra as well.

//set the throughput for the database
RequestOptions options = new RequestOptions
{
    OfferThroughput = 500
};

//create the database
await client.CreateDatabaseIfNotExistsAsync(
    new Database {Id = databaseName},  
    options);

[!code-csharp]


Next steps

See the following articles to learn about provisioned throughput in Azure Cosmos DB: