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
+43-25Lines changed: 43 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.author: sidandrews
7
7
ms.reviewer: mjbrown
8
8
ms.service: cosmos-db
9
9
ms.topic: conceptual
10
-
ms.date: 02/27/2023
10
+
ms.date: 04/15/2023
11
11
ms.custom: ignite-2022
12
12
---
13
13
@@ -93,18 +93,46 @@ Depending on the current RU/s provisioned and resource settings, each resource c
93
93
94
94
¹ Serverless containers up to 1 TB are currently in preview with Azure Cosmos DB. To try the new feature, register the *"Azure Cosmos DB Serverless 1 TB Container Preview"*[preview feature in your Azure subscription](../azure-resource-manager/management/preview-features.md).
95
95
96
-
## Control plane operations
96
+
## Control plane
97
97
98
-
You can [create and manage your Azure Cosmos DB 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.
98
+
Azure Cosmos DB maintains a resource provider that offers a management layer to create, update, and delete resources in your Azure Cosmos DB account. The resource provider interfaces with the overall Azure Resource Management layer, which is the deployment and management service for Azure. You can [create and manage Azure Cosmos DB resources](how-to-manage-database-account.md) using the Azure portal, Azure PowerShell, Azure CLI, Azure Resource Manager and Bicep templates, Rest API, Azure Management SDKs as well as 3rd party tools such as Terraform and Pulumi.
99
+
100
+
This management layer can also be accessed from the Azure Cosmos DB data plane SDKs used in your applications to create and manage resources within an account. Data plane SDKs also make control plane requests during initial connection to the service to do things like enumerating databases and containers, as well as requesting account keys for authentication.
101
+
102
+
Each account for Azure Cosmos DB has a `master partition` which contains all of the metadata for an account. It also has a small amount of throughput to support control plane operations. Control plane requests that create, read, update or delete this metadata consumes this throughput. When the amount of throughput consumed by control plane operations exceeds this amount, operations are rate-limited, same as data plane operations within Azure Cosmos DB. However, unlike throughput for data operations, throughput for the master partition cannot be increased.
103
+
104
+
Some control plane operations do not consume master partition throughput, such as Get or List Keys. However, unlike requests on data within your Azure Cosmos DB account, resource providers within Azure are not designed for high request volumes. **Control plane operations that exceed the documented limits at sustained levels over consecutive 5-minute periods here may experience request throttling as well failed or incomplete operations on Azure Cosmos DB resources**.
105
+
106
+
Control plane operations can be monitored by navigating the Insights tab for an Azure Cosmos DB account. To learn more see [Monitor Control Plane Requests](use-metrics.md#monitor-control-plane-requests). Users can also customize these, use Azure Monitor and create a workbook to monitor [Metadata Requests](monitor-reference.md#request-metrics) and set alerts on them.
107
+
108
+
### Resource limits
109
+
110
+
The following table lists resource limits per subscription or account.
99
111
100
112
| Resource | Limit |
101
113
| --- | --- |
102
114
| Maximum number of accounts per subscription | 50 by default. ¹ |
103
-
| Maximum number of regional failovers | 10/hour by default. ¹ ² |
115
+
| Maximum number of databases & containers per account | 500 ² |
116
+
| Maximum throughput supported by an account for metadata operations | 240 RU/s |
104
117
105
118
¹ You can increase these limits by creating an [Azure Support request](create-support-request-quota-increase.md) up to 1,000 max.
119
+
² This limit cannot be increased. Total count of both with an account. (1 database and 499 containers, 250 databases and 250 containers, etc.)
120
+
121
+
### Request limits
122
+
123
+
The following table lists request limits per 5 minute interval, per account, unless otherwise specified.
124
+
125
+
| Operation | Limit |
126
+
| --- | --- |
127
+
| Maximum List or Get Keys | 500 ¹ |
128
+
| Maximum Create database & container | 500 |
129
+
| Maximum Get or List database & container | 500 ¹ |
130
+
| Maximum Update provisioned throughput | 25 |
131
+
| Maximum regional failover | 10 (per hour) ² |
132
+
| Maximum number of all operations (PUT, POST, PATCH, DELETE, GET) not defined above | 500 |
106
133
107
-
² Regional failovers only apply to single region writes accounts. Multi-region write accounts don't require or have any limits on changing the write region.
134
+
¹ Users should use [singleton client](nosql/best-practice-dotnet.md#checklist) for SDK instances and cache keys and database and container references between requests for the lifetime of that instance.
135
+
² Regional failovers only apply to single region writes accounts. Multi-region write accounts don't require or allow changing the write region.
108
136
109
137
Azure 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).
110
138
@@ -116,17 +144,15 @@ Here's a list of limits per account.
116
144
117
145
| Resource | Limit |
118
146
| --- | --- |
119
-
| Maximum number of databases per account | 500 |
120
-
| Maximum number of containers per database with shared throughput |25 |
121
-
| Maximum number of containers per account | 500 |
147
+
| Maximum number of databases and containers per account | 500 |
148
+
| Maximum number of containers per database with shared throughput | 25 |
122
149
| Maximum number of regions | No limit (All Azure regions) |
123
150
124
151
### Serverless
125
152
126
153
| Resource | Limit |
127
154
| --- | --- |
128
-
| Maximum number of databases per account | 100 |
129
-
| Maximum number of containers per account | 100 |
155
+
| Maximum number of databases and containers per account | 100 |
130
156
| Maximum number of regions | 1 (Any Azure region) |
131
157
132
158
## Per-container limits
@@ -178,6 +204,8 @@ Azure Cosmos DB supports [CRUD and query operations](/rest/api/cosmos-db/) again
178
204
| Maximum response size (for example, paginated query) | 4 MB |
179
205
| Maximum number of operations in a transactional batch | 100 |
180
206
207
+
Azure Cosmos DB supports execution of triggers during writes. The service supports a maximum of one pre-trigger and one post-trigger per write operation.
208
+
181
209
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's no practical limit on the duration a single query can run across pages/continuations.
182
210
183
211
Azure Cosmos DB uses HMAC for authorization. You can use either a primary key, or a [resource token](secure-access-to-data.md) for fine-grained access control to resources. These resources can include containers, partition keys, or items. The following table lists limits for authorization tokens in Azure Cosmos DB.
@@ -191,19 +219,6 @@ Azure Cosmos DB uses HMAC for authorization. You can use either a primary key, o
191
219
192
220
¹ You can increase it by [filing an Azure support ticket](create-support-request-quota-increase.md)
193
221
194
-
Azure Cosmos DB supports execution of triggers during writes. The service supports a maximum of one pre-trigger and one post-trigger per write operation.
195
-
196
-
## Metadata request limits
197
-
198
-
Azure Cosmos DB maintains system metadata for each account. This metadata allows you to enumerate collections, databases, other Azure Cosmos DB resources, and their configurations for free of charge.
199
-
200
-
| Resource | Limit |
201
-
| --- | --- |
202
-
|Maximum collection create rate per minute| 100|
203
-
|Maximum Database create rate per minute| 100|
204
-
|Maximum provisioned throughput update rate per minute| 5|
205
-
|Maximum throughput supported by an account for metadata operations | 240 RU/s |
206
-
207
222
## Limits for autoscale provisioned throughput
208
223
209
224
See the [Autoscale](provision-throughput-autoscale.md#autoscale-limits) article and [FAQ](autoscale-faq.yml#lowering-the-max-ru-s) for more detailed explanation of the throughput and storage limits with autoscale.
@@ -241,13 +256,16 @@ The following table lists the limits specific to MongoDB feature support. Other
241
256
242
257
| Resource | Limit |
243
258
| --- | --- |
259
+
| Maximum size of a document | 16 MB (UTF-8 length of JSON representation) ¹ |
244
260
| Maximum MongoDB query memory size (This limitation is only for 3.2 server version) | 40 MB |
245
261
| Maximum execution time for MongoDB operations (for 3.2 server version)| 15 seconds|
246
262
| Maximum execution time for MongoDB operations (for 3.6 and 4.0 server version)| 60 seconds|
247
263
| Maximum level of nesting for embedded objects / arrays on index definitions | 6 |
248
-
| Idle connection timeout for server side connection closure ¹ | 30 minutes |
264
+
| Idle connection timeout for server side connection closure ² | 30 minutes |
265
+
266
+
¹ Large document sizes up to 16 MB require feature enablement in Azure portal. Read the [feature documentation](../cosmos-db/mongodb/feature-support-42.md#data-types) to learn more.
249
267
250
-
¹ We recommend that client applications set the idle connection timeout in the driver settings to 2-3 minutes because the [default timeout for Azure LoadBalancer is 4 minutes](../load-balancer/load-balancer-tcp-idle-timeout.md). This timeout ensures that an intermediate load balancer idle doesn't close connections between the client machine and Azure Cosmos DB.
268
+
² We recommend that client applications set the idle connection timeout in the driver settings to 2-3 minutes because the [default timeout for Azure LoadBalancer is 4 minutes](../load-balancer/load-balancer-tcp-idle-timeout.md). This timeout ensures that an intermediate load balancer idle doesn't close connections between the client machine and Azure Cosmos DB.
This article describes how to manage various tasks on an Azure Cosmos DB account by using the Azure portal.
18
+
This article describes how to manage various tasks on an Azure Cosmos DB account by using the Azure portal. Azure Cosmos DB can also be managed with other Azure management clients including [Azure PowerShell](manage-with-powershell.md), [Azure CLI](nosql/manage-with-cli.md), [Azure Resource Manager templates](./manage-with-templates.md), [Bicep](nosql/manage-with-bicep.md), and [Terraform](nosql/samples-terraform.md).
19
19
20
20
> [!TIP]
21
-
> Azure Cosmos DB can also be managed with other Azure management clients including [Azure PowerShell](manage-with-powershell.md), [Azure CLI](sql/manage-with-cli.md), [Azure Resource Manager templates](./manage-with-templates.md), and [Bicep](sql/manage-with-bicep.md).
21
+
> The management API for Azure Cosmos DB or *control plane* is not designed for high request volumes like the rest of the service. To learn more see [Control Plane Service Limits](concepts-limits.md#control-plane)
22
22
23
23
## Create an account
24
24
@@ -108,6 +108,7 @@ After an Azure Cosmos DB account is configured for service-managed failover, the
108
108
109
109
:::image type="content" source="./media/how-to-manage-database-account/manual-failover.png" alt-text="Screenshot of the manual failover portal menu.":::
110
110
111
+
111
112
## Next steps
112
113
113
114
For more information and examples on how to manage the Azure Cosmos DB account as well as databases and containers, read the following articles:
Copy file name to clipboardExpand all lines: articles/cosmos-db/how-to-setup-rbac.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@ title: Configure role-based access control with Azure AD
3
3
titleSuffix: Azure Cosmos Db
4
4
description: Learn how to configure role-based access control with Azure Active Directory for your Azure Cosmos DB account
5
5
author: seesharprun
6
+
ms.service: cosmos-db
7
+
ms.topic: how-to
8
+
ms.date: 04/14/2023
6
9
ms.author: sidandrews
7
10
ms.reviewer: mjbrown
8
-
ms.service: cosmos-db
9
-
ms.topic: conceptual
10
-
ms.date: 02/27/2023
11
11
ms.custom: ignite-2022
12
12
---
13
13
@@ -39,11 +39,10 @@ The Azure Cosmos DB data plane role-based access control is built on concepts th
39
39
## <aid="permission-model"></a> Permission model
40
40
41
41
> [!IMPORTANT]
42
-
> This permission model covers only database operations that involve reading and writing data. It does *not* cover any kind of management operations on management resources, for example:
43
-
>
42
+
> This permission model covers only database operations that involve reading and writing data. It **does not** cover any kind of management operations on management resources, including:
44
43
> - Create/Replace/Delete Database
45
44
> - Create/Replace/Delete Container
46
-
> - Replace Container Throughput
45
+
> -Read/Replace Container Throughput
47
46
> - Create/Replace/Delete/Read Stored Procedures
48
47
> - Create/Replace/Delete/Read Triggers
49
48
> - Create/Replace/Delete/Read User Defined Functions
@@ -91,7 +90,7 @@ The Azure Cosmos DB SDKs issue read-only metadata requests during initialization
91
90
- The partition key of your containers or their indexing policy.
92
91
- The list of physical partitions that make a container and their addresses.
93
92
94
-
They don't* fetch any of the data that you've stored in your account.
93
+
They **do not** fetch any of the data that you've stored in your account.
95
94
96
95
To ensure the best transparency of our permission model, these metadata requests are explicitly covered by the `Microsoft.DocumentDB/databaseAccounts/readMetadata` action. This action should be allowed in every situation where your Azure Cosmos DB account is accessed through one of the Azure Cosmos DB SDKs. It can be assigned (through a role assignment) at any level in the Azure Cosmos DB hierarchy (that is, account, database, or container).
97
96
@@ -103,6 +102,9 @@ The actual metadata requests allowed by the `Microsoft.DocumentDB/databaseAccoun
103
102
| Database |• Reading database metadata <br /> • Listing the containers under the database <br /> • For each container under the database, the allowed actions at the container scope |
104
103
| Container |• Reading container metadata <br /> • Listing physical partitions under the container <br /> • Resolving the address of each physical partition |
105
104
105
+
> [!IMPORTANT]
106
+
> Throughput is not included in the metadata for this action.
107
+
106
108
## Built-in role definitions
107
109
108
110
Azure Cosmos DB exposes two built-in role definitions:
| TotalRequests (Total Requests) | Count (Count) | Number of requests made| DatabaseName, CollectionName, Region, StatusCode| All | TotalRequests, Http 2xx, Http 3xx, Http 400, Http 401, Internal Server error, Service Unavailable, Throttled Requests, Average Requests per Second | Used to monitor requests per status code, container at a minute granularity. To get average requests per second, use Count aggregation at minute and divide by 60. |
27
-
| MetadataRequests (Metadata Requests) |Count (Count) | Count of metadata requests. Azure Cosmos DB maintains system metadata container for each account, that allows you to enumerate collections, databases, etc., and their configurations, free of charge. | DatabaseName, CollectionName, Region, StatusCode| All||Used to monitor throttles due to metadata requests.|
27
+
| MetadataRequests (Metadata Requests) |Count (Count) | Count of Azure Resource Manager metadata requests. Metadata has request limits. See [Control Plane Limits](concepts-limits.md#control-plane) for more information. | DatabaseName, CollectionName, Region, StatusCode| All||Used to monitor metadata requests in scenarios where requests are being throttled. See [Monitor Control Plane Requests](use-metrics.md#monitor-control-plane-requests) for more information. |
28
28
| MongoRequests (Mongo Requests) | Count (Count) | Number of Mongo Requests Made | DatabaseName, CollectionName, Region, CommandName, ErrorCode| All |Mongo Query Request Rate, Mongo Update Request Rate, Mongo Delete Request Rate, Mongo Insert Request Rate, Mongo Count Request Rate| Used to monitor Mongo request errors, usages per command type. |
29
29
30
30
### Request Unit metrics
@@ -90,7 +90,7 @@ The following table lists the properties of resource logs in Azure Cosmos DB. Th
90
90
|**duration**|**duration_d**| The duration of the operation, in milliseconds. |
91
91
|**requestLength**|**requestLength_s**| The length of the request, in bytes. |
92
92
|**responseLength**|**responseLength_s**| The length of the response, in bytes.|
93
-
|**resourceTokenPermissionId**|**resourceTokenPermissionId_s**| This property indicates the resource token permission Id that you have specified. To learn more about permissions, see the [Secure access to your data](./secure-access-to-data.md#permissions) article. |
93
+
|**resourceTokenPermissionId**|**resourceTokenPermissionId_s**| This property indicates the resource token permission ID that you have specified. To learn more about permissions, see the [Secure access to your data](./secure-access-to-data.md#permissions) article. |
94
94
|**resourceTokenPermissionMode**|**resourceTokenPermissionMode_s**| This property indicates the permission mode that you have set when creating the resource token. The permission mode can have values such as "all" or "read". To learn more about permissions, see the [Secure access to your data](./secure-access-to-data.md#permissions) article. |
95
95
|**resourceTokenUserRid**|**resourceTokenUserRid_s**| This value is non-empty when [resource tokens](./secure-access-to-data.md#resource-tokens) are used for authentication. The value points to the resource ID of the user. |
96
96
|**responseLength**|**responseLength_s**| The length of the response, in bytes.|
0 commit comments