Įvykiai
Kurti DI programėles ir agentus
03-17 21 - 03-21 10
Prisijunkite prie meetup serijos, kad sukurtumėte keičiamo dydžio DI sprendimus, pagrįstus realaus pasaulio naudojimo atvejais, su kolegomis kūrėjais ir ekspertais.
Registruotis dabarŠi naršyklė nebepalaikoma.
Atnaujinkite į „Microsoft Edge“, kad pasinaudotumėte naujausiomis funkcijomis, saugos naujinimais ir techniniu palaikymu.
APPLIES TO:
NoSQL
This article explains how to provision standard (manual) throughput on a container in Azure Cosmos DB for NoSQL. You can provision throughput on a single container, or provision throughput on a database and share it among the containers within the database. You can provision throughput on a container using Azure portal, Azure CLI, 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 Container. Next, provide the following details:
/ItemID
).
To create a container with dedicated throughput see,
Pastaba
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.
// 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 });
// Create a new Client
const client = new CosmosClient({ endpoint, key });
// Create a database
const { database } = await client.databases.createIfNotExists({ id: "databaseId" });
// Create a container with the specified throughput
const { resource } = await database.containers.createIfNotExists({
id: "containerId",
throughput: 1000
});
// To update an existing container or databases throughput, you need to user the offers API
// Get all the offers
const { resources: offers } = await client.offers.readAll().fetchAll();
// Find the offer associated with your container or the database
const offer = offers.find((_offer) => _offer.offerResourceId === resource._rid);
// Change the throughput value
offer.content.offerThroughput = 2000;
// Replace the offer.
await client.offer(offer.id).replace(offer);
See the following articles to learn about throughput provisioning in Azure Cosmos DB:
Įvykiai
Kurti DI programėles ir agentus
03-17 21 - 03-21 10
Prisijunkite prie meetup serijos, kad sukurtumėte keičiamo dydžio DI sprendimus, pagrįstus realaus pasaulio naudojimo atvejais, su kolegomis kūrėjais ir ekspertais.
Registruotis dabarMokymas
Modulis
Configure Azure Cosmos DB for NoSQL - Training
Select between the various throughput offerings in Azure Cosmos DB for NoSQL.
Sertifikatas
Microsoft Certified: Azure Cosmos DB Developer Specialty - Certifications
Write efficient queries, create indexing policies, manage, and provision resources in the SQL API and SDK with Microsoft Azure Cosmos DB.