Amazon DocumentDB
Developer Guide

Amazon DocumentDB Limits

This topic describes the resource limits and naming constraints for Amazon DocumentDB (with MongoDB compatibility).

For certain management features, Amazon DocumentDB uses operational technology that is shared with Amazon Relational Database Service (Amazon RDS) and Amazon Neptune.

Supported Instance Types

Amazon DocumentDB supports on-demand instances and the following instance types:

  • Memory Optimized:

    • Current Generation:

      R5 instance types: db.r5.large, db.r5.2xlarge, db.r5.4xlarge, db.r5.12xlarge, db.r5.24xlarge.

      R4 instance types: db.r4.large, db.r4.2xlarge, db.r4.4xlarge, db.r4.8xlarge, db.r4.16xlarge.

For more information on the supported instance types and their specifications, see Instance Class Specifications.

Supported Regions

Amazon DocumentDB is available in the following AWS regions:

Region Name Region Availability Zones (compute)

US East (Ohio)

us-east-2

3

US East (N. Virginia)

us-east-1

6

US West (Oregon)

us-west-2

4

Asia Pacific (Mumbai)

ap-south-1

2

Asia Pacific (Seoul)

ap-northeast-2

3

Asia Pacific (Sydney)

ap-southeast-2

2

Asia Pacific (Singapore)

ap-southeast-1

3

Asia Pacific (Tokyo)

ap-northeast-1

3

Canada (Central)

ca-central-1

3

Europe (Frankfurt)

eu-central-1

3

Europe (Ireland)

eu-west-1

3

Europe (London)

eu-west-2

3

Europe (Paris)

eu-west-3

3

Regional Limits

For certain management features, Amazon DocumentDB uses operational technology that is shared with Amazon Relational Database Service (Amazon RDS) and Amazon Neptune. The following table contains regional limits that are shared among Amazon DocumentDB, Amazon RDS, and Neptune.

The following limits are per AWS account per region.

Resource Default Limit
Clusters 40
Instances 40
Event subscriptions 20
Manual cluster snapshots 100
Cluster parameter groups 50
Read replicas per cluster 15
VPC security groups per instance 5
Subnet groups 50
Subnets per subnet group 20
Tags per resource 50

You can take the following steps to request an increase for limits. These increases are not granted immediately, so it may take a couple of days for your increase to become effective.

To request a limit increase

  1. Open the AWS Support Center page at https://console.aws.amazon.com/support/home, sign in if necessary, and choose Create case.

  2. For Regarding, choose Service Limit Increase.

  3. For Limit type, choose RDS from the list.

  4. Complete the form. If this request is urgent, choose Phone as the method of contact instead of Web.

  5. Choose Submit.

Aggregation Limits

The following table describes aggregation limits in Amazon DocumentDB.

Resource Default Limit
Maximum number of supported stages 500

Cluster Limits

The following table describes Amazon DocumentDB cluster limits.

Resource Limit
Cluster size (sum of all collections and indexes) 64 TB
Database size (sum of all databases can't exceed cluster limit) 64 TB
Collection size
 (sum of all collections can't exceed cluster limit) – does not include the index size 32 TB
Collections per cluster 100,000
Document size 16 MB
Document nesting depth 100 levels
Indexes per collection 64
Index key size (for arrays, the entire array must be less than 2,048 bytes) 2,048 bytes
Keys in a compound index 32
Number of users per cluster 100
Maximum number of writes in a single batch command 100,000

Instance Limits

The following table describes Amazon DocumentDB limits per instance.

Resource Limit
Number of concurrent connections by instance type db.r5.large – 1,100

db.r4.large – 1,100

db.r5.xlarge – 2,700

db.r4.xlarge – 2,700

db.r5.2xlarge – 4,500

db.r4.2xlarge – 4,500

db.r5.4xlarge – 4,500

db.r4.4xlarge – 4,500

db.r4.8xlarge – 4,500

db.r5.12xlarge – 4,500

db.r4.16xlarge – 4,500

db.r5.24xlarge – 4,500

Maximum number of open cursors per instance 450

Naming Constraints

The following table describes naming constraints in Amazon DocumentDB.

Resource Default Limit
Cluster identifier
  • Length is [1–63] letters, numbers, or hyphens.

  • First character must be a letter.

  • Cannot end with a hyphen or contain two consecutive hyphens.

  • Must be unique for all clusters (across Amazon RDS, Amazon Neptune, and Amazon DocumentDB) per AWS account, per Region.

Instance identifier
  • Length is [1–63] letters, numbers, or hyphens

  • First character must be a letter

  • Cannot end with a hyphen or contain two consecutive hyphens

  • Must be unique for all instances (across Amazon RDS, Amazon Neptune, and Amazon DocumentDB) per AWS account, per Region.

Master user name
  • Length is [1-63] alphanumeric characters.

  • First character must be a letter.

  • Cannot be a word reserved by the database engine.

Master password
  • Length is [8-100] printable ASCII characters.

  • Can use any printable ASCII characters except for the following:

    • / (forward slash)

    • " (double quotation mark)

    • @ (at symbol)

Parameter group name
  • Length is [1–255] alphanumeric characters.

  • First character must be a letter.

  • Cannot end with a hyphen or contain two consecutive hyphens.

Database name: <db>

Length is [1–63] characters.

Collection name: <col>

Length is [1–57] characters.

Fully qualified collection name: <db>.<col> Length is [3–120] characters.
Index name: <col>$<index>

Length is [3–63] characters.

Fully qualified index name: <db>.<col>.$<index> Length is [6–127] characters.

TTL Constraints

Deletes from a TTL index are not guaranteed within a specific timeframe and are best effort. Factors like instance resource utilization, document size, and overall throughput can affect the timing of a TTL delete.