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 |
[!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.
-
Sign in to the Azure portal.
-
Create a new Azure Cosmos DB account, or select an existing Azure Cosmos DB account.
-
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":::
To create a database with shared throughput see,
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);
See the following articles to learn about provisioned throughput in Azure Cosmos DB: