|
| 1 | +--- |
| 2 | +title: Service Limits in Azure Cosmos DB for MongoDB vCore |
| 3 | +description: This document outlines the service limits for vCore-based Azure Cosmos DB for MongoDB. |
| 4 | +author: gahl-levy |
| 5 | +ms.author: gahllevy |
| 6 | +ms.service: cosmos-db |
| 7 | +ms.subservice: mongodb-vcore |
| 8 | +ms.topic: conceptual |
| 9 | +ms.date: 06/27/2024 |
| 10 | +--- |
| 11 | + |
| 12 | +# Service Limits in Azure Cosmos DB for MongoDB vCore |
| 13 | + |
| 14 | +This document provides an overview of the service limits for Azure Cosmos DB for MongoDB vCore. |
| 15 | + |
| 16 | +## Query and Execution Limits |
| 17 | + |
| 18 | +### Maximum MongoDB Query Memory Size |
| 19 | +- The maximum memory size for MongoDB queries depends on the tier. For example, for M80, the query memory size limit is approximately 150 MiB. |
| 20 | +- In sharded clusters, if a query pulls data across nodes, the limit on that data size is 1GB. |
| 21 | + |
| 22 | +### Maximum Execution Time for MongoDB Operations |
| 23 | +- Maximum transaction lifetime: 30 seconds. |
| 24 | +- Cursor lifetime: 10 minutes. Note: A cursorNotFound error might occur if the cursor exceeds its lifetime. |
| 25 | +- Default: 120 seconds. This can be overridden on a per-query basis using `maxTimeMS`. |
| 26 | +#### Example: |
| 27 | +```javascript |
| 28 | +db.collection.find({ field: "value" }).maxTimeMS(5000) |
| 29 | +``` |
| 30 | + |
| 31 | +## Indexing Limits |
| 32 | + |
| 33 | +### General Indexing Limits |
| 34 | +- Maximum number of compound index paths: 32. |
| 35 | +- Maximum size for `_id` field value: 2KB. |
| 36 | +- Maximum size for index path: 256B. |
| 37 | +- Sorting is done in memory and does not push down to the index. |
| 38 | +- Background index builds are in private preview. To enable, customers need to file a support ticket. |
| 39 | +- A single index build can be in progress on the same collection. |
| 40 | +- The number of simultaneous index builds on different collections is configurable (default: 2). |
| 41 | +- Use the `currentOp` command to view the progress of long-running index builds. |
| 42 | +- Unique index builds are done in the foreground and block writes in the collection. |
| 43 | +- Composite indexes do not support geospatial indexes (2d, 2d sphere indexes). |
| 44 | + |
| 45 | +### Wildcard Indexing Limits |
| 46 | +- No specific limits; restrictions mirror MongoDB wildcard index restrictions. |
| 47 | +- For wildcard indexes, if the indexed field is an array of arrays, the entire embedded array is taken as a value instead of traversing its contents. |
| 48 | + |
| 49 | +### Geospatial Indexing Limits |
| 50 | +- No support for BigPolygons. |
| 51 | +- Composite indexes do not support geospatial indexes. |
| 52 | +- `$geoWithin` query does not support polygons with holes. |
| 53 | +- The `key` field is required in the `$geoNear` aggregation stage. |
| 54 | +- Indexes are recommended but not required for `$near`, `$nearSphere` query operators, and the `$geoNear` aggregation stage. |
| 55 | + |
| 56 | +### Text Index Limits |
| 57 | +- Only one text index can be defined on a collection. |
| 58 | +- Supports simple text searches only; advanced search capabilities like regular expression searches are not supported. |
| 59 | +- `hint()` is not supported in combination with a query using `$text` expression. |
| 60 | +- Sort operations cannot use the ordering of the text index. |
| 61 | +- Tokenization for Chinese, Japanese, Korean is not supported yet. |
| 62 | +- Case insensitive tokenization is not supported yet. |
| 63 | + |
| 64 | +### Vector Search Limits |
| 65 | +- Supported distance metrics: L2 (Euclidean), inner product, and cosine. |
| 66 | +- Supported indexing methods: IVFFLAT (GA) and HSNW. |
| 67 | +- Indexing vectors up to 2,000 dimensions in size. |
| 68 | +- Indexing applies to only one vector per path. |
| 69 | +- Only one index can be created per vector path. |
| 70 | + |
| 71 | +## Storage and Connection Limits |
| 72 | + |
| 73 | +### Disk IOPS |
| 74 | +| Disk Size (GiB) | IOPS per Disk | |
| 75 | +|-----------------|---------------| |
| 76 | +| 32 | 120 | |
| 77 | +| 64 | 240 | |
| 78 | +| 128 | 500 | |
| 79 | +| 256 | 1,100 | |
| 80 | +| 512 | 2,300 | |
| 81 | +| 1 TB | 5,000 | |
| 82 | +| 2 TB | 7,500 | |
| 83 | +| 4 TB | 7,500 | |
| 84 | +| 8 TB | 16,000 | |
| 85 | +| 16 TB | 18,000 | |
| 86 | +| 32 TB | 20,000 | |
| 87 | + |
| 88 | +## Cluster and Shard Limits |
| 89 | + |
| 90 | +### Cluster Tier |
| 91 | +- Maximum: M200. Contact support for higher tiers. |
| 92 | + |
| 93 | +### Shards |
| 94 | +- Maximum: 6 (in preview). Contact support for additional shards. |
| 95 | + |
| 96 | +### Secondary Regions |
| 97 | +- Maximum: 1. Contact support for additional regions. |
| 98 | + |
| 99 | +### Free Tier Limits |
| 100 | +The following limitations can be overidden by upgrading a paid tier |
| 101 | +- Maximum storage: 32GB. |
| 102 | +- Backup / Restore not supported (available in M25+) |
| 103 | +- High availability (HA) not supported (available in M30+) |
| 104 | +- HNSW vector indexes not supported (available in M40+) |
| 105 | +- Diagnostic logging not supported (available in M30+) |
| 106 | +- No service-level-agreement provided (requires HA to be enabled) |
| 107 | + |
| 108 | +## Collection, Index, and Database Limits |
| 109 | + |
| 110 | +### Indexes |
| 111 | +- Default maximum: 64. |
| 112 | +- Configurable up to: 300 indexes per collection. |
| 113 | + |
| 114 | +## Replication and HA Limits |
| 115 | + |
| 116 | +### Cross-Region Replication |
| 117 | +- Supported only on single shard (node) vCore clusters. |
| 118 | +- The following configurations are the same on both primary and replica clusters and cannot be changed on the replica cluster: |
| 119 | + - Compute configuration |
| 120 | + - Storage and shard count |
| 121 | + - User accounts |
| 122 | +- HA is not supported on replica clusters. |
| 123 | +- Cross-region replication is not available on clusters with burstable compute. |
| 124 | + |
| 125 | +## Miscellaneous Limits |
| 126 | + |
| 127 | +### Nesting Levels |
| 128 | +- Maximum level of nesting for embedded objects/arrays on index definitions: 6. |
| 129 | + |
| 130 | +### Portal Mongo Shell Usage |
| 131 | +- The Portal Mongo Shell can be used for 120 minutes within a 24-hour window. |
| 132 | + |
| 133 | +## Next steps |
| 134 | + |
| 135 | +- Get started by [creating a cluster.](quickstart-portal.md). |
| 136 | +- Review options for [migrating from MongoDB to Azure Cosmos DB for MongoDB vCore.](migration-options.md) |
| 137 | + |
| 138 | + |
| 139 | + |
0 commit comments