Επεξεργασία

Κοινή χρήση μέσω


Provision database, container or autoscale throughput on Azure Cosmos DB for Gremlin resources

APPLIES TO: Gremlin

This article explains how to provision throughput in Azure Cosmos DB for Gremlin. You can provision standard(manual) or autoscale throughput on a container, or a database and share it among the containers within the database. You can provision throughput using Azure portal, Azure CLI, or Azure Cosmos DB SDKs.

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

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 Graph. Next, provide the following details:

    • Indicate whether you are creating a new database or using an existing one. Select the Provision database throughput option if you want to provision throughput at the database level.
    • Enter a graph ID.
    • Enter a partition key value (for example, /ItemID).
    • Enter a throughput that you want to provision (for example, 1000 RUs).
    • Select OK.

    Screenshot of Data Explorer, when creating a new graph with database level throughput

.NET SDK

Note

Use the Azure Cosmos DB SDKs for API for NoSQL to provision throughput for all Azure Cosmos DB APIs, except Cassandra and API for MongoDB.

Provision container level throughput

// Create a container with a partition key and provision throughput of 400 RU/s
DocumentCollection myCollection = new DocumentCollection();
myCollection.Id = "myContainerName";
myCollection.PartitionKey.Paths.Add("/myPartitionKey");

await client.CreateDocumentCollectionAsync(
    UriFactory.CreateDatabaseUri("myDatabaseName"),
    myCollection,
    new RequestOptions { OfferThroughput = 400 });

Provision database level throughput

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

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

Azure Resource Manager

Azure Resource Manager templates can be used to provision autoscale throughput on database or container-level resources for all Azure Cosmos DB APIs. See Azure Resource Manager templates for Azure Cosmos DB for samples.

Azure CLI

Azure CLI can be used to provision autoscale throughput on a database or container-level resources for all Azure Cosmos DB APIs. For samples see Azure CLI Samples for Azure Cosmos DB.

Azure PowerShell

Azure PowerShell can be used to provision autoscale throughput on a database or container-level resources for all Azure Cosmos DB APIs. For samples see Azure PowerShell samples for Azure Cosmos DB.

Next steps

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