A request unit (RU) is Azure Cosmos DB’s measure of the resources an operation consumes. Reads, writes, and queries cost different amounts depending on their complexity: reading a 1 KB item might use 1 RU, while a query that filters and sorts several items might use 10 RUs or more. section 11.1
Provisioned throughput is measured in request units per second (RU/s). At 400 RU/s, a collection could handle about 400 of those simple reads each second, or fewer costly operations. More capacity supports more work, but provisioned throughput also affects the bill. section 11.1
C:/> az cosmosdb mongodb collection create --account-name alpacacosmosdbaccount --database-name alpacacosmosdb --name alpacacontainer --resource-group AlpacaRG --shard "/alpacakey" --throughput 400
This Azure CLI command creates a MongoDB collection with `--throughput 400`, setting its provisioned capacity to 400 RU/s. section 11.1
When holiday traffic arrives
Autoscaling can accommodate changing demand, but a busy sales period may raise throughput costs. Multi-region replication adds storage and request-unit charges. Monitor RU consumption alongside latency, and set an alert when consumption crosses a chosen threshold so the team can respond before demand becomes a surprise. section 11.1.3 section 11.6.2
C:/> az monitor metrics alert create --name "High RU Consumption"
--resource-group AlpacaRG --scopes /subscriptions/
{subscription-id}/resourceGroups/AlpacaRG/providers/Microsoft.DocumentDB/
databaseAccounts/alpacacosmosdbaccount
--condition "avg totalRequestUnits > 900" --window-size 5m
--evaluation-frequency 1m --action {action-group}
This Azure Monitor CLI example alerts an action group when average `totalRequestUnits` exceeds 900 over a five-minute window, checked every minute. section 11.6.2
