Understanding the price model
This section provides a brief overview of how your bill is influenced by the way you use DocumentDB. There are a few factors that determine the pricing:
- Having a DocumentDB account
- Number of collections inside a database
- Performance level
- Capacity units
Account charges
When you set up a DocumentDB account, you will be billed immediately. An empty account with no databases and hence no collections will be charged for a single S1 collection, at around $25 per month. The reason that you are charged while not having any collections or documents is that Microsoft needs to reserve a DNS and authorization scope for the account.
Number of collections
Collections are billed by the hour. Having a collection for only 10 minutes will still incur charges for a whole hour. An amount of 10 GB is included for all tiers.
The following table defines the standard characteristics per performance level:
Performance level |
SSD storage |
Request units |
Price per hour |
---|---|---|---|
S1 |
10 GB |
250 per second |
$0.034 |
S2 |
10 GB |
1,000 per second |
$0.067 |
S3 |
10 GB |
2,500 per second |
$0.134 |
Request units are calculated based on the amount of resources that are needed for the operation performed. When more CPU, IO, and memory is needed for a certain operation, more request units are calculated. The number of request units needed for each operation is returned in the response's header (x-ms-request-charge). By reading this value, you can keep track of the usage. If you exceed the number of request units, additional operations will be throttled.
To have fine-grained control over the performance of your collections, you could do the housekeeping of consumed Requests Units (RUs) yourself and check if you often exceed the maximum number of RUs. If so, upgrading the performance level for your collection might be a good idea.
Note
It is possible to upgrade and downgrade a collection from S1 to S2 or S3, but the charges are for the highest tier. Switching from S1 to S3 within 1 hour will therefore be billed at $0.134.
Request Units
The number of RUs needed for an operation depends on the following factors:
- Size of the document: Larger documents increase the consumption of RUs.
- Number of properties: More properties increase the consumption of RUs. When you use data consistency (we will dive into this concept later on), more RUs will be consumed.
- Indexes: When more properties are indexed, more RUs are needed. It is good practice to investigate the actual indexes you need for you scenario. Also, documents are indexed by default; turning this feature off will save RUs. SP and triggers also consume RUs based on the metrics mentioned previously.
Understanding storage
By default, a collection is provisioned with 10 GB of storage. Documents consume storage space, but indexes also fill up the space of a collection. If you need more storage space, you need to create a different collection.
Expanding resources
Microsoft offers the ability to contact Azure support from the Azure blade portal (portal.azure.com). If you need specific adjustments that you cannot manage from the portal or that are not supported by default, contact Azure support.
Click on the New Support button and follow the wizard that shows up. Make sure you choose the Quotas request type and enter your request details. The following table shows the limits that can be stretched by Azure support:
Database accounts |
5 |
Number of SPs, triggers and UDFs per collection |
25 each |
Maximum collections per database account |
100 |
Maximum document storage per database (100 collections) |
1 TB |
Maximum number of UDFs per query |
1 |
Maximum number of JOINs per query |
2 |
Maximum number of AND clauses per query |
5 |
Maximum number of OR clauses per query |
5 |
Maximum number of values per IN expression |
100 |
Maximum number of collection created per minute |
5 |