Amazon DocumentDB (with MongoDB compatibility) is a fully managed document database service that supports MongoDB workloads. With Amazon DocumentDB, you only pay for what you use, and there are no upfront costs. Amazon DocumentDB is priced in four dimensions:
- On-demand instances The amount of compute instances for a cluster (pricing per second with a 10-minute minimum)
- Database I/O: The amount of I/O used when reading and writing data to your cluster’s storage volume (pricing per million I/Os).
- Database storage: The amount of data stored in your cluster's storage volume (pricing per GB/month).
- Backup storage: The amount of backup storage used in excess of your cluster’s database storage usage (pricing per GB/month).
Other AWS-wide costs such as data transfer between applications and Amazon DocumentDB across Availability Zones (AZs) may also apply.
DocumentDB Cost Optimization
Amazon DocumentDB helps you optimize costs with the following features:
Per-second billing: Amazon DocumentDB provides per second billing for instances, with a 10-minute minimum billing period.
Pause instances: You can temporarily stop compute instances for up to seven days when you don’t need to access your cluster (great for pausing test clusters over the weekend) and restart the instances when needed.
Single-instance durability: Amazon DocumentDB instances are not data bearing, so you can provision a highly durable cluster with just a single instance, a popular approach for development clusters.
Low-cost backup: You get backup storage equivalent to 100 percent of your cluster’s data storage for free each month (e.g., if your cluster has 10 TB of stored data, you get 10 TB of backup for free). Additional backup storage beyond the free allotment is priced as low as $0.02 per GB/month (prices may vary across AWS regions).
Automatic scaling: Amazon DocumentDB’s storage and I/O automatically scale to your workload, so you pay only for the resources you use, without needing to pre-provision.
Data replication: Amazon DocumentDB storage is highly durable and available, replicating data six ways across three AZs. While DocumentDB maintains six copies of your data, you pay only for a single copy, with pricing as low as $0.10 GB/month (prices may vary across AWS regions).
No-cost encryption and monitoring: Features like encryption at-rest with AWS Key Management Service (AWS KMS), encryption in-transit with Transport Layer Security (TLS), and monitoring with AWS CloudWatch are available for all clusters at no additional cost.
Premium support plans: Choose from AWS premium support plans with transparent pricing to match your needs. See AWS Support Plan Pricing for more information.
Free cluster instance transfer across AZs: Data transferred across Availability Zones between cluster instances is free.
On-Demand Instance Pricing
On-demand instances let you pay per second, with no long-term commitments or upfront fees. This frees you from the cost and complexity of planning and purchasing database capacity in advance and having to guess the correct capacity. Pricing is per instance-hour consumed, from the time an instance is launched until it is stopped or deleted. Partial instance hours are billed in one-second increments, with a 10-minute minimum charge following a billable status change such as creating, modifying, or deleting an instance.
Instance pricing applies to both the primary and the replica instances in a cluster. Amazon DocumentDB utilizes a multi-Availability Zone (AZ) architecture for high availability. The cost of multi-AZ deployments is simply the cost of the primary instance plus the cost of each replica instance. To maximize availability, we recommend placing at least one replica in a different AZ from the primary instance. Data transferred between AZs for replication of multi-AZ deployments is free.
Amazon DocumentDB T3 and T4g medium instances run in unlimited mode, which means that you will be charged if your average CPU utilization over a rolling 24-hour period exceeds the baseline of the instance. CPU Credits are charged at $0.09 per vCPU-Hour. The CPU Credit pricing is the same for all T3 and T4 instance sizes across all regions. For more information on how unlimited burstable performance instances work and how they are priced, see unlimited mode concepts.
Database Storage and I/Os
You pay only for the storage and I/Os that your Amazon DocumentDB cluster consumes, and you do not need to provision these resources in advance.
Storage consumed by your Amazon DocumentDB cluster is billed per GB-month. Billable storage includes your data, indexes, and change stream data. For more information, see Amazon DocumentDB Storage.
I/Os are input/output operations performed by the Amazon DocumentDB engine when performing reads and writes against cluster’s storage volume. I/Os are billed per million I/O requests. API calls like find, insert, update, and delete, features like change streams and TTL indexes, and tools like mongodump and mongorestore all use I/Os by reading and/or writing from the storage volume.
Read operations (8K pages) from the storage volume counts as one I/O. Once, once the data has been read from the storage volume and continues to reside in memory, subsequent reads of the same data do not incur additional I/Os. To reduce read I/Os, it is important that your instance is properly sized and your application’s working set fits in memory. See Instance Sizing in the best practices documentation.
Write I/Os are only consumed when pushing transaction log records to the storage layer for the purpose of making writes durable. Write I/Os are counted in 4 KB units. For example, a transaction log record that is 1024 bytes will count as one I/O operation. However, concurrent write operations whose transaction log is less than 4 KB can be batched together by the Amazon DocumentDB database engine in order to optimize I/O consumption. Unlike traditional database engines, DocumentDB never pushes modified database pages to the storage layer, resulting in further I/O consumption savings.
Amazon DocumentDB implements a multi-version concurrency control (MVCC) database architecture and creates a new versioned document and index entry for every update operation. Versioned documents are managed transparently by DocumentDB. An MVCC architecture improves query throughput and provides read isolation, as read queries can use versioned documents instead of taking locks.
When queries no longer require an older version of a document or an index entry, a garbage collector reclaims the old document and index entry. The garbage collector runs periodically to inspect old documents and index entries, which results in read I/Os to load the old documents and index entries into memory, if they are not already present, and write I/Os to delete them. To minimize I/Os that result from garbage collection, it is recommended that you remove unused indexes and scale instances so that indexes fit in memory. For more information, see the Amazon DocumentDB best practices documentation.
Amazon DocumentDB Global Clusters is an optional feature that provides fast replication across regions with latencies less than one second using dedicated infrastructure with little to no impact to your workload’s performance. With global clusters, you can recover from region-wide outages and serve low-latency global reads by allowing reads from the nearest DocumentDB cluster. You pay for replicated write I/Os between the primary region and each secondary region. The number of replicated write I/Os to each secondary region is the same as the number of in-region write I/Os performed by the primary region. Apart from replicated write I/Os, you pay standard DocumentDB rates for instances, storage, cross-region data transfer, and backup storage
Except as otherwise noted, our prices are exclusive of applicable taxes and duties, including VAT and applicable sales tax. For customers with a billing address in Japan, use of AWS is subject to Japanese Consumption Tax. Learn more.
Backup storage for an Amazon DocumentDB cluster is the storage associated with your automated cluster backups and any manual cluster snapshots. Increasing your backup retention period or taking manual cluster snapshots increases the backup storage consumed.
Backup storage is allocated by region. Total backup storage space is equivalent to the sum of the storage for all backups in that region.
Copying a snapshot to another region increases allocated backup storage in the destination region.
There is no additional charge for backup storage of up to 100 percent of your total Amazon DocumentDB cluster storage for a region. There is also no additional charge for backup storage if your backup retention period is one day and you do not have any manual snapshots beyond the backup retention period. Backup storage beyond this amount and manual snapshots retained outside of the backup retention period, whether your cluster is active or has been deleted, are billed at storage rates in the table below.
The pricing below is based on data transferred “in” and “out” of Amazon DocumentDB.
Except as otherwise noted, our prices are exclusive of applicable taxes and duties, including VAT and applicable sales tax. For customers with a Japanese billing address, use of AWS is subject to Japanese Consumption Tax. Learn more.
Data transferred between Amazon DocumentDB and Amazon Elastic Compute Cloud (EC2) instances in the same Availability Zone is free.
Data transferred between AZs for replication of multi-AZ deployments is free.
Amazon DocumentDB instances inside Amazon Virtual Private Cloud (VPC): For data transferred between an Amazon EC2 instance and DocumentDB instance in different AZs of the same Region, EC2 Regional Data Transfer charges apply on both sides of transfer.
Assume that your Amazon DocumentDB cluster is running a two-instance db.r5.large cluster (on-demand) in US East (N. Virginia), you store 50 GB of data with 50 GB backup, and perform 200 million I/Os per month.
The on-demand pricing for db.r5.large instance is $0.277 per hour, so your monthly cost for the two instances will be $404.42 ($0.277 * 730 * 2).
Your storage cost will be $0.10 per GB/month, so for 50 GB storage, your (30-day) monthly cost will be $5 ($0.10 * 50). There will be no additional charge for your backup storage because it does not exceed your data storage for the region.
Your I/O cost will be $0.20 per million request increments, so for your 200 million I/Os per month, your cost will be $40.00 ($0.20 * 200).
Your total monthly bill for Amazon DocumentDB for this example would be $449.42 ($404.42 for instance + $5.00 for storage + $40.00 for I/O).
Learn how to get started quickly.
Instantly get access to the AWS Free Tier.
Get started building with Amazon DocumentDB in the AWS Console.