Skip to content

Commit dc78263

Browse files
Merge pull request #77159 from arramac/master
Cosmos DB Limits Doc
2 parents dd129ea + 707edf1 commit dc78263

File tree

3 files changed

+179
-2
lines changed

3 files changed

+179
-2
lines changed

articles/azure-subscription-service-limits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags: billing
88
ms.assetid: 60d848f9-ff26-496e-a5ec-ccf92ad7d125
99
ms.service: billing
1010
ms.topic: article
11-
ms.date: 04/19/2019
11+
ms.date: 05/17/2019
1212
ms.author: byvinyal
1313

1414
---
@@ -245,7 +245,7 @@ The following table shows the limits for Azure BizTalk Services.
245245
[!INCLUDE [biztalk-services-service-limits](../includes/biztalk-services-service-limits.md)]
246246

247247
### Azure Cosmos DB limits
248-
Azure Cosmos DB is a global scale database in which throughput and storage can be scaled to handle whatever your application requires. If you have any questions about the scale Azure Cosmos DB provides, send email to [email protected].
248+
For Azure Cosmos DB limits, see [Limits in Azure Cosmos DB](cosmos-db/concepts-limits.md).
249249

250250
### Azure Database for MySQL
251251
For Azure Database for MySQL limits, see [Limitations in Azure Database for MySQL](mysql/concepts-limits.md).

articles/cosmos-db/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@
216216
href: online-backup-and-restore.md
217217
- name: Compliance
218218
href: compliance.md
219+
- name: Limits
220+
href: concepts-limits.md
219221
- name: Cassandra, MongoDB, and other APIs
220222
expanded: true
221223
items:

articles/cosmos-db/concepts-limits.md

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
---
2+
title: Limits in Azure Cosmos DB
3+
description: This article describes limits in Azure Cosmos DB.
4+
author: arramac
5+
ms.author: arramac
6+
ms.service: cosmos-db
7+
ms.topic: conceptual
8+
ms.date: 05/19/2019
9+
---
10+
11+
# Limits in Azure Cosmos DB
12+
13+
This article provides an overview of the limits in the Azure Cosmos DB service.
14+
15+
## Storage and throughput
16+
17+
After you create an Azure Cosmos account under your subscription, you can manage data in your account by [creating databases, containers, and items](databases-containers-items.md). You can provision throughput at a container-level or a database-level in terms of [request units (RU/s or RUs)](request-units.md). The following table lists the limits for storage and throughput per container/database.
18+
19+
| Resource | Default limit |
20+
| --- | --- |
21+
| Maximum RUs per container ([dedicated throughput provisioned mode](databases-containers-items.md#azure-cosmos-containers)) | 1,000,000 by default. You can increase it by [filing an Azure support ticket](https://docs.microsoft.com/azure/azure-supportability/how-to-create-azure-support-request) or contacting us via [Ask Cosmos DB](mailto:[email protected]) |
22+
| Maximum RUs per database ([shared throughput provisioned mode](databases-containers-items.md#azure-cosmos-containers)) | 1,000,000 by default. You can increase it by [filing an Azure support ticket](https://docs.microsoft.com/azure/azure-supportability/how-to-create-azure-support-request) or contacting us via [Ask Cosmos DB](mailto:[email protected]) |
23+
| Maximum RUs per (logical) partition key | 10,000 |
24+
| Maximum storage across all items per (logical) partition key| 10 GB |
25+
| Maximum number of distinct (logical) partition keys | Unlimited |
26+
| Maximum storage per container | Unlimited |
27+
| Maximum storage per database | Unlimited |
28+
29+
> [!NOTE]
30+
> For best practices to manage workloads that have partition keys that need higher limits for storage or throughput, see [Designing for Hot Partition Keys](synthetic-partition-keys.md)
31+
>
32+
33+
A Cosmos container (or shared throughput database) must have a minimum throughput of 400 RUs. As the container grows, the minimum supported throughput also depends on the following factors:
34+
35+
* The maximum storage consumed in the container is measured in increments of 40 RUs per GB of consumed storage. For example, if a container contains 100 GB of data, then the throughput must be at least 4000 RUs
36+
* The maximum throughput ever provisioned on the container. The service supports lowering throughput of a container to 10% of the provisioned maximum. For example, if your throughput was increased to 10000 RUs, then the lowest possible provisioned throughput would be 1000 RUs
37+
* The total number of containers that you have ever created in a shared throughput database, measured at 100 RUs per container. For example, if you have created five containers within a shared throughput database, then the throughput must be at least 500 RUs
38+
39+
The current and minimum throughput of a container or a database can be retrieved from the Azure portal or the SDKs. For more information, see [Provision throughput on containers and databases](set-throughput.md). In summary, here are the minimum provisioned RU limits.
40+
41+
| Resource | Default limit |
42+
| --- | --- |
43+
| Minimum RUs per container ([dedicated throughput provisioned mode](databases-containers-items.md#azure-cosmos-containers)) | 400 |
44+
| Minimum RUs per database ([shared throughput provisioned mode](databases-containers-items.md#azure-cosmos-containers)) | 400 |
45+
| Minimum RUs per container within a shared throughput database | 100 |
46+
| Minimum RUs per GB of consumed storage | 40 |
47+
48+
Cosmos DB supports elastic scaling of throughput (RUs) per container or database via the SDKs or portal. Each container can scale synchronously and immediately within a scale range of 10 to 100 times, between minimum and maximum values. If the requested throughput value is outside the range, scaling is performed asynchronously. Asynchronous scaling may take minutes to hours to complete depending on the requested throughput and data storage size in the container.
49+
50+
## Control plane operations
51+
52+
You can [provision and manage your Azure Cosmos account](how-to-manage-database-account.md) using the Azure portal, Azure PowerShell, Azure CLI, and Azure Resource Manager templates. The following table lists the limits per subscription, account, and number of operations.
53+
54+
| Resource | Default limit |
55+
| --- | --- |
56+
| Maximum database accounts per subscription | 50 by default. You can increase it by [filing an Azure support ticket](https://docs.microsoft.com/azure/azure-supportability/how-to-create-azure-support-request) or contacting us via [Ask Cosmos DB](mailto:[email protected])|
57+
| Maximum number of regional failovers | 1/hour by default. You can increase it by [filing an Azure support ticket](https://docs.microsoft.com/azure/azure-supportability/how-to-create-azure-support-request) or contacting us via [Ask Cosmos DB](mailto:[email protected])|
58+
59+
> [!NOTE]
60+
> Regional failovers only apply to single region writes accounts. Multi-region write accounts do not require or have any limits on changing the write region.
61+
62+
Cosmos DB automatically takes backups of your data at regular intervals. For details on backup retention intervals and windows, see [Online backup and on-demand data restore in Azure Cosmos DB](online-backup-and-restore.md).
63+
64+
## Per-container limits
65+
66+
Depending on which API you use, an Azure Cosmos container can represent either a collection, a table, or graph. Containers support configurations for [unique key constraints](unique-keys.md), [stored procedures, triggers, and UDFs](stored-procedures-triggers-udfs.md), and [indexing policy](how-to-manage-indexing-policy.md). The following table lists the limits specific to configurations within a container.
67+
68+
| Resource | Default limit |
69+
| --- | --- |
70+
| Maximum length of database or container name | 255 |
71+
| Maximum stored procedures per container | 100 <sup>*</sup>|
72+
| Maximum UDFs per container | 25 <sup>*</sup>|
73+
| Maximum number of paths in indexing policy| 100 <sup>*</sup>|
74+
| Maximum number of unique keys per container|10 <sup>*</sup>|
75+
| Maximum number of paths per unique key constraint|16 <sup>*</sup>|
76+
77+
<sup>*</sup> You can increase any of these per-container limits by contacting Azure Support or contacting us via [Ask Cosmos DB](mailto:[email protected]).
78+
79+
## Per-item limits
80+
81+
Depending on which API you use, an Azure Cosmos item can represent either a document in a collection, a row in a table, or a node or edge in a graph. The following table shows the limits per item in Cosmos DB.
82+
83+
| Resource | Default limit |
84+
| --- | --- |
85+
| Maximum size of an item | 2 MB (UTF-8 length of JSON representation) |
86+
| Maximum length of partition key value | 2048 bytes |
87+
| Maximum length of id value | 1024 bytes |
88+
| Maximum number of properties per item | No practical limit |
89+
| Maximum nesting depth | No practical limit |
90+
| Maximum length of property name | No practical limit |
91+
| Maximum length of property value | No practical limit |
92+
| Maximum length of string property value | No practical limit |
93+
| Maximum length of numeric property value | IEEE754 double-precision 64-bit |
94+
95+
There are no restrictions on the item payloads like number of properties and nesting depth, except for the length restrictions on partition key and id values, and the overall size restriction of 2 MB. You may have to configure indexing policy for containers with large or complex item structures to reduce RU consumption. See [Modeling items in Cosmos DB](how-to-model-partition-example.md) for a real-world example, and patterns to manage large items.
96+
97+
## Per-request limits
98+
99+
Cosmos DB supports [CRUD and query operations](https://docs.microsoft.com/rest/api/cosmos-db/) against resources like containers, items, and databases.
100+
101+
| Resource | Default limit |
102+
| --- | --- |
103+
| Maximum execution time for a single operation (like a stored procedure execution or a single query page retrieval)| 5 sec |
104+
| Maximum request size (stored procedure, CRUD)| 2 MB |
105+
| Maximum response size (for example, paginated query) | 4 MB |
106+
107+
Once an operation like query reaches the execution timeout or response size limit, it returns a page of results and a continuation token to the client to resume execution. There is no practical limit on the duration a single query can run across pages/continuations.
108+
109+
Cosmos DB uses HMAC for authorization. You can use either a master key, or a [resource tokens](secure-access-to-data.md) for fine-grained access control to resources like containers, partition keys, or items. The following table lists limits for authorization tokens in Cosmos DB.
110+
111+
| Resource | Default limit |
112+
| --- | --- |
113+
| Maximum master token expiry time | 15 min |
114+
| Minimum resource token expiry time | 10 min |
115+
| Maximum resource token expiry time | 24 h by default. You can increase it by [filing an Azure support ticket](https://docs.microsoft.com/azure/azure-supportability/how-to-create-azure-support-request) or contacting us via [Ask Cosmos DB](mailto:[email protected])|
116+
| Maximum clock skew for token authorization| 15 min |
117+
118+
Cosmos DB supports execution of triggers during writes. The service supports a maximum of one pre-trigger and one post-trigger per write operation.
119+
120+
## SQL query limits
121+
122+
Cosmos DB supports querying items using [SQL](how-to-sql-query.md). The following table describes restrictions in query statements, for example in terms of number of clauses or query length.
123+
124+
| Resource | Default limit |
125+
| --- | --- |
126+
| Maximum length of SQL query| 256 KB <sup>*</sup>|
127+
| Maximum JOINs per query| 5 <sup>*</sup>|
128+
| Maximum ANDs per query| 2000 <sup>*</sup>|
129+
| Maximum ORs per query| 2000 <sup>*</sup>|
130+
| Maximum UDFs per query| 10 <sup>*</sup>|
131+
| Maximum arguments per IN expression| 6000 <sup>*</sup>|
132+
| Maximum points per polygon| 4096 <sup>*</sup>|
133+
134+
<sup>*</sup> You can increase any of these SQL query limits by contacting Azure Support or contacting us via [Ask Cosmos DB](mailto:[email protected]).
135+
136+
## MongoDB API-specific limits
137+
138+
Cosmos DB supports the MongoDB wire protocol for applications written against MongoDB. You can find the supported commands and protocol versions at [Supported MongoDB features and syntax](mongodb-feature-support.md).
139+
140+
The following table lists the limits specific to MongoDB feature support. Other service limits mentioned for the SQL (core) API also apply to the MongoDB API.
141+
142+
| Resource | Default limit |
143+
| --- | --- |
144+
| Maximum MongoDB query memory size | 40 MB |
145+
| Maximum execution time for MongoDB operations| 30s |
146+
147+
## Try Cosmos DB Free limits
148+
149+
The following table lists the limits for the [Try Azure Cosmos DB for Free](https://azure.microsoft.com/try/cosmosdb/) trial.
150+
151+
| Resource | Default limit |
152+
| --- | --- |
153+
| Duration of the trial | 30 days (can be renewed any number of times) |
154+
| Maximum containers per subscription (SQL, Gremlin, Table API) | 1 |
155+
| Maximum containers per subscription (MongoDB API) | 3 |
156+
| Maximum throughput per container | 5000 |
157+
| Maximum throughput per shared-throughput database | 20000 |
158+
| Maximum total storage per account | 10 GB |
159+
160+
Try Cosmos DB supports global distribution in only the Central US, North Europe, and Southeast Asia regions. Azure support tickets can't be created for Try Azure Cosmos DB accounts. However, support is provided for subscribers with existing support plans.
161+
162+
## Next steps
163+
164+
Read more about Cosmos DB's core concepts [global distribution](distribute-data-globally.md) and [partitioning](partitioning-overview.md) and [provisioned throughput](request-units.md).
165+
166+
Get started with Azure Cosmos DB with one of our quickstarts:
167+
168+
* [Get started with Azure Cosmos DB SQL API](create-sql-api-dotnet.md)
169+
* [Get started with Azure Cosmos DB's API for MongoDB](create-mongodb-nodejs.md)
170+
* [Get started with Azure Cosmos DB Cassandra API](create-cassandra-dotnet.md)
171+
* [Get started with Azure Cosmos DB Gremlin API](create-graph-dotnet.md)
172+
* [Get started with Azure Cosmos DB Table API](create-table-dotnet.md)
173+
174+
> [!div class="nextstepaction"]
175+
> [Try Azure Cosmos DB for free](https://azure.microsoft.com/try/cosmosdb/)

0 commit comments

Comments
 (0)