MongoDB is one of the most popular NoSQL databases for a reason: its ease of use, ability to manage huge amounts of unstructured data, and strong developer ecosystem make it a go-to choice for cloud-native applications. Its open-source offering has been around since 2009 but it wasn’t until 2016 that its managed service, MongoDB Atlas, launched on AWS. Amazon DocumentDB was released to compete in early 2019 as a managed NoSQL database designed for applications using MongoDB’s API.

While Amazon claims MongoDB compatibility, DocumentDB is not a true drop-in replacement—certain features and commands are missing or behave differently, which means some applications may require modifications to work properly. Still, some users consider DocumentDB for its tight integration with AWS services or in cases where MongoDB Atlas removes features that DocumentDB still supports.

When evaluating the two, one of the biggest deciding factors is cost. In a production scenario, we found DocumentDB to be 26.7% more expensive than MongoDB Atlas.

MongoDB Atlas Pricing

MongoDB has both cloud and self-managed deployment options. MongoDB Atlas is MongoDB’s fully managed cloud database service, making it the most comparable to Amazon DocumentDB. It consists of a free tier for learning use cases, a flex tier for development and testing use cases, and a dedicated tier for production use cases.

The dedicated tier supports deployments for the three major cloud providers—AWS, GCP, and Azure. For AWS, there are 12 cluster tiers, ranging from 10 GB of storage, 2 GB of RAM, and 2 vCPUs to 4000 GB of storage, 768 GB of RAM, and 96 vCPUs. There are additional cluster options for Low-CPU and Local NVMe SSD as well. Charges apply only for the time the instance is running and vary based on region.

Cluster Tier vCPUs GB of RAM GB of Storage Base Price per Hour
M10 2 2 10 $0.08
M20 2 4 20 $0.20
M30 2 8 40 $0.54
M40 4 16 80 $1.04
M50 8 32 160 $2.00
M60 16 64 320 $3.95
M80 32 128 750 $7.30
M140 48 192 1000 $10.99
M200 64 256 1500 $14.59
M300 96 384 2000 $21.85
M400 64 488 3000 $22.40
M700 96 768 4000 $33.26

MongoDB Atlas dedicated cluster pricing for AWS N Virginia (us-east-1) (scroll to see full table)

To ensure high availability MongoDB Atlas automatically deploys clusters across two or three AWS Availability Zones (AZs) (depending on how many AWS AZs there are for the selected region).

Additional costs include data transfer, additional storage, and backups.

Amazon DocumentDB Pricing

Like MongoDB Atlas, Amazon DocumentDB charges based on instance type while instances are active. It offers 29 instance options, including burstable types for lower-cost workloads and high-performance options for demanding applications. The price depends on region and the chosen pricing model—Standard or I/O-Optimized. I/O-Optimized costs more for compute and storage, but does not charge for I/O requests. It is more cost-effective for cases where I/O costs exceed 25% of database cluster spend.

Instance vCPU GiB of Memory Amazon DocumentDB Standard Price per hour Amazon DocumentDB I/O-Optimized Price per hour
db.r6g.large 2 16 $0.26 $0.29
db.r6g.xlarge 4 32 $0.53 $0.58
db.r6g.2xlarge 8 64 $1.05 $1.16
db.r6g.4xlarge 16 128 $2.11 $2.32
db.r6g.8xlarge 32 256 $4.21 $4.63
db.r6g.12xlarge 48 384 $6.32 $6.95
db.r6g.16xlarge 64 512 $8.42 $9.26
db.r5.large 2 16 $0.28 $0.31
db.r5.xlarge 4 32 $0.55 $0.61
db.r5.2xlarge 8 64 $1.11 $1.22
db.r5.4xlarge 16 128 $2.22 $2.44
db.r5.8xlarge 32 256 $4.43 $4.87
db.r5.12xlarge 48 384 $6.65 $7.31
db.r5.16xlarge 64 512 $8.86 $9.75
db.r5.24xlarge 96 768 $13.30 $14.63
db.r4.large 2 15.25 $0.28 $0.31
db.r4.xlarge 4 30.5 $0.55 $0.61
db.r4.2xlarge 8 61 $1.11 $1.22
db.r4.4xlarge 16 122 $2.22 $2.44
db.r4.8xlarge 32 244 $4.43 $4.88
db.r4.16xlarge 64 488 $8.86 $9.75
db.r6gd.xlarge 4 32 $0.64 $0.64
db.r6gd.2xlarge 8 64 $1.28 $1.28
db.r6gd.4xlarge 16 128 $2.57 $2.57
db.r6gd.8xlarge 32 256 $5.14 $5.14
db.r6gd.12xlarge 48 384 $7.71 $7.71
db.r6gd.16xlarge 64 512 $10.27 $10.27
db.t4g.medium 2 4 $0.076 $0.083
db.t3.medium 2 4 $0.078 $0.086

Amazon DocumentDB instance pricing for N Virginia (us-east-1) (scroll to see full table)

Amazon recommends multi-AZ deployments for high availability, however, unlike MongoDB Atlas, you are charged for it. Costs are per primary instance plus each secondary instance.

Charges are separate for compute, storage, and if applicable, I/O, making it easy to tailor to your specific use case.

Component Amazon DocumentDB Standard Price Amazon DocumentDB I/O-Optimized Price
Storage Rate $0.10 per GB-month $0.30 per GB-month
I/O Rate $0.20 per 1 million requests Included

Amazon DocumentDB stotage and I/O pricing for N Virginia (us-east-1)

Charges also apply for data transfer, backup storage, and optional features such as Elastic clusters.

MongoDB vs DocumentDB Pricing

Some initial observations before we dive into the pricing scenario:

  • MongoDB Atlas instances generally offer four times the memory relative to vCPU count, whereas DocumentDB instances provide up to eight times the memory per vCPU.
  • While MongoDB Atlas includes multi-AZ replication at no extra cost, DocumentDB charges for each additional secondary instance, making high-availability deployments more expensive.
  • Storage, compute, and I/O operations are completely separate for DocumentDB, allowing for more customization.
  • Data transfer costs are relatively similar between both services, though AWS provides a tiered structure with lower rates for large amounts of internet-bound traffic.

MongoDB Atlas vs Amazon DocumentDB Pricing Scenario

A local mid-sized e-commerce company running a high-traffic online store is evaluating MongoDB Atlas and Amazon DocumentDB for their database needs. Their workload includes frequent product catalog updates, customer order processing, and real-time inventory tracking. Given their traffic patterns and need for high availability, they plan to deploy a 16 vCPU instance with 300 GB of storage in a multi-AZ setup.

For MongoDB Atlas, they look at the M60 cluster which has 16 vCPU, 64 GB of RAM, and 320 GB of storage included. The hourly cost is $3.95. For a month with 720 hours (24 hours x 30 days) the total monthly cost is $2,844 ($3.95 x 720 hours).

For DocumentDB, due to high-IO rates, they opt for the I/O-Optimized plan. They evaluate the newest generation Graviton instance with 16 vCPUs and 128 GB of RAM, db.r5.4xlarge. The hourly cost is $2.44, making the monthly cost for one instance $1,756.8 ($2.44 x 720 hours). However, since it is a production database that needs to be highly available, they will need another instance in a different AZ, bringing the cost to $3,513.6 ($1756.8 x 2 instances).

Finally, the 300 GB of storage for Document DB is charged at $.30 per GB-month, corresponding to $90 ($.30 x 300 GB) in monthly storage costs and bringing the total to $3,603.6.

Amazon DocumentDB is 26.7% more expensive than MongoDB Atlas in this scenario.

Conclusion

MongoDB Atlas has a catalog of useful features, multi-cloud deployment options, and predictable pricing. DocumentDB provides ease of use and seamless integration with AWS services. When comparing the pricing between the two for production workloads where high-availability is a requirement, we found MongoDB Atlas to be the cost-effective choice.