Επεξεργασία

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

APPLIES TO: NoSQL

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.

    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);

Next steps

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