AWSAmazon DocumentDBDatabase

aws_documentdb_cluster cost estimation

MongoDB-compatible managed document database. Instance-hour ($0.277/hour for db.r6g.large) plus storage ($0.10/GB-month) plus I/O ($0.20/M-requests). Backup storage above retention is $0.021/GB-month.

Amazon DocumentDB is a MongoDB-compatible managed database service. The aws_documentdb_cluster represents the cluster; aws_documentdb_cluster_instance represents individual nodes. Pricing has three components: instance hours, storage, I/O.

Instance hours: $0.277/hour for db.r6g.large (us-east-1). Compared to MongoDB Atlas, DocumentDB is roughly competitive on smaller instances but cheaper on larger ones. Multi-AZ clusters bill each replica separately.

Storage: $0.10/GB-month for data stored in the cluster volume. Storage is shared across all instances in the cluster (Aurora-style architecture), not per-instance.

I/O: $0.20 per 1M request units. This often dominates the bill for write-heavy workloads. A write-heavy workload doing 1B requests/month adds $200 in I/O alone.

Backup storage: 1 day of backup retention is included free. Beyond that, $0.021/GB-month. Cluster snapshots have the same backup rate.

The pricing model is similar to Aurora. The cluster volume is shared across replica instances, so you only pay for storage once, even with 5 read replicas. I/O is the gotcha — DocumentDB I/O rates are higher than RDS I/O rates for the same workload.

c3x estimates DocumentDB based on instance class, replica count, allocated storage, and (via c3x-usage.yml) expected I/O volume.

Terraform example

A minimal but realistic configuration that C3X can estimate.

resource "aws_docdb_cluster" "main" {
  cluster_identifier      = "prod-docdb"
  engine                  = "docdb"
  master_username         = "admin"
  master_password         = var.docdb_password
  backup_retention_period = 7
  preferred_backup_window = "07:00-09:00"
  skip_final_snapshot     = false
}

resource "aws_docdb_cluster_instance" "primary" {
  count              = 2
  identifier         = "prod-docdb-${count.index}"
  cluster_identifier = aws_docdb_cluster.main.id
  instance_class     = "db.r6g.large"
}

Pricing dimensions

What you actually pay for when you provision aws_documentdb_cluster.

DimensionUnitWhat's being charged
Instance hoursper hour per instanceHourly cost of compute. Each replica bills its own instance hours.
$0.277/hour for db.r6g.large
Storageper GB-monthCluster volume storage. Shared across all instances; only paid once regardless of replica count.
$0.10/GB-month
I/Oper 1M request unitsDatabase I/O operations. Often dominates total cost on write-heavy workloads.
$0.20 per 1M IOs
Backup storageper GB-monthBackup storage above the included free retention. Backups are incremental.
$0.021/GB-month

Optimization tips

Common ways to reduce aws_documentdb_cluster cost without changing the workload.

Use Graviton instances (r6g)

20% on instance hours

r6g (Graviton) instances are 20% cheaper than r5 (x86) for the same nominal capacity. Migrate clusters to db.r6g class when possible. No application changes required.

Use reserved instances for steady workloads

30-60% on commitment

Reserved Instances for DocumentDB save 30-60% over on-demand. 1-year all-upfront commits give the deepest discount. Right after the workload baseline is stable.

Reduce I/O via indexing

Up to 90% on I/O

DocumentDB bills per I/O. Queries that scan vs queries that hit indexes can differ by 1000x in I/O volume. Profile slow queries via Profiler and add covering indexes.

Right-size replicas

$1,600/month per right-sized replica

Each replica bills its own instance hours. Five replicas at db.r6g.4xlarge = ~$8,000/month in instance hours. Many fleets over-provision read replicas. Audit read traffic distribution.

FAQ

Is DocumentDB really MongoDB?

It's API-compatible up to MongoDB 5.0 (as of 2026). Most queries and drivers work unchanged. Some MongoDB features aren't supported: change streams have differences, some aggregation operators are missing, no native time-series collections. Test workloads before migrating.

How does DocumentDB pricing compare to MongoDB Atlas?

Roughly competitive. Atlas M30 (similar to db.r6g.large) is ~$0.30/hour vs DocumentDB's $0.277/hour. Atlas includes some I/O in the base price; DocumentDB charges separately. For high-I/O workloads, Atlas can be cheaper. For low-I/O workloads, DocumentDB tends to win.

Do replicas share storage?

Yes. The cluster volume is shared across all instances. Adding a replica only adds instance hours, not storage cost. This makes DocumentDB cheaper than MongoDB Atlas's replica set model for read-scaling.

Can I run Serverless DocumentDB?

DocumentDB Elastic Clusters (introduced 2023) offer auto-scaling shard capacity. Pricing is per Elastic Compute Unit-hour. For workloads with highly variable load, Elastic Clusters can be cheaper than provisioned. For steady workloads, standard clusters are cheaper.

Related resources

Estimate this resource in your own Terraform

Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_documentdb_cluster.