You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/concepts-limits.md
+21-9Lines changed: 21 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ ms.date: 05/19/2019
9
9
---
10
10
11
11
# Limits in Azure Cosmos DB
12
+
12
13
This article provides an overview of the limits in the Azure Cosmos DB service.
13
14
14
15
## Storage and throughput
@@ -33,7 +34,7 @@ A Cosmos container (or shared throughput database) must have a minimum throughpu
33
34
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
35
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
36
-
* The total number of containers that you have ever created in a shared database, measured at 100 RUs per container. For example, if you have created five containers within a shared database, then the throughput must be at least 500 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
37
38
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.
39
40
@@ -47,6 +48,7 @@ The current and minimum throughput of a container or a database can be retrieved
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.
48
49
49
50
## Control plane operations
51
+
50
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.
51
53
52
54
| Resource | Default limit |
@@ -60,6 +62,7 @@ You can [provision and manage your Azure Cosmos account](how-to-manage-database-
60
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).
61
63
62
64
## Per-container limits
65
+
63
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.
64
67
65
68
| Resource | Default limit |
@@ -71,9 +74,10 @@ Depending on which API you use, an Azure Cosmos container can represent either a
71
74
| Maximum number of unique keys per container|10 <sup>*</sup>|
72
75
| Maximum number of paths per unique key constraint|16 <sup>*</sup>|
73
76
74
-
<sup>*</sup> You can increase any of these per-contianer limits by contacting Azure Support or contacting us via [Ask Cosmos DB](mailto:[email protected]).
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]).
75
78
76
79
## Per-item limits
80
+
77
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.
78
82
79
83
| Resource | Default limit |
@@ -91,15 +95,16 @@ Depending on which API you use, an Azure Cosmos item can represent either a docu
91
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.
92
96
93
97
## Per-request limits
98
+
94
99
Cosmos DB supports [CRUD and query operations](https://docs.microsoft.com/rest/api/cosmos-db/) against resources like containers, items, and databases.
95
100
96
101
| Resource | Default limit |
97
102
| --- | --- |
98
-
| Maximum execution time for single operations (CRUD or single paginated query)| 5 sec |
103
+
| Maximum execution time for a single operation (like a stored procedure execution or a single query page retrieval)| 5 sec |
99
104
| Maximum request size (stored procedure, CRUD)| 2 MB |
100
105
| Maximum response size (for example, paginated query) | 4 MB |
101
106
102
-
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.
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.
103
108
104
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.
105
110
@@ -113,6 +118,7 @@ Cosmos DB uses HMAC for authorization. You can use either a master key, or a [re
113
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.
114
119
115
120
## SQL query limits
121
+
116
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.
117
123
118
124
| Resource | Default limit |
@@ -128,21 +134,23 @@ Cosmos DB supports querying items using [SQL](how-to-sql-query.md). The followin
128
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]).
129
135
130
136
## MongoDB API-specific limits
131
-
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).
132
137
133
-
The following table lists the limits specific to MongoDB feature support. Other service limits mentioned for the core (SQL) API also apply to the MongoDB API.
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.
134
141
135
142
| Resource | Default limit |
136
143
| --- | --- |
137
144
| Maximum MongoDB query memory size | 40 MB |
138
145
| Maximum execution time for MongoDB operations| 30s |
139
146
140
147
## Try Cosmos DB Free limits
141
-
The following table lists the limits for the [Try Azure Cosmos DB for Free](https://azure.microsoft.com/try/cosmosdb/) trial.
148
+
149
+
The following table lists the limits for the [Try Azure Cosmos DB for Free](https://azure.microsoft.com/try/cosmosdb/) trial.
142
150
143
151
| Resource | Default limit |
144
152
| --- | --- |
145
-
| Duration for the subscription|Duration of the trial (can be renewed any number of times) |
153
+
| Duration of the trial|30 days (can be renewed any number of times) |
146
154
| Maximum containers per subscription (SQL, Gremlin, Table API) | 1 |
147
155
| Maximum containers per subscription (MongoDB API) | 3 |
148
156
| Maximum throughput per container | 5000 |
@@ -151,4 +159,8 @@ The following table lists the limits for the [Try Azure Cosmos DB for Free](http
151
159
152
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.
153
161
154
-
<sup>1</sup> You can increase these limits by contacting Azure Support or contacting us via [Ask Cosmos DB](mailto:[email protected]).
162
+
## Next steps
163
+
164
+
* Learn more about [Provisioned throughput in Cosmos DB](request-units.md)
165
+
*[How to manage conflict resolution policies](how-to-manage-conflicts.md)
166
+
*[How to read from the conflicts feed](how-to-manage-conflicts.md#read-from-conflict-feed)
0 commit comments