mongodbdatabasecost-optimizationaws

MongoDB Atlas vs self-hosted: the real cost of managing it yourself

Atlas M30 costs about $394 per month. The same three-node replica set on EC2 costs about $230 in instances. The $164 gap is not the whole story, and for most teams it is not even the important part. Here is the full accounting.

The C3X Team··7 min read

Quick answer

MongoDB Atlas M30 (2 vCPU, 8 GB, three-node replica set) runs about $0.54 per hour, roughly $394 per month on AWS, including storage, backups, monitoring, and automated failover. Self-hosting the same three-node replica set on three m6i.large instances costs about $0.288 per hour, roughly $210 per month, plus about $35 for 100 GB of gp3 per node (three copies) and backup storage, landing near $280 per month. The infrastructure gap is roughly $114 per month, around 29 percent. That gap is consumed by a fraction of one engineer's time: at a loaded cost of $200,000 per year, four hours of operational work per month exceeds the saving.

The self-hosting argument for MongoDB is usually framed as a large saving. It is worth running the numbers, because at small and medium scale the saving is modest and easily consumed by operational time, while at large scale the picture genuinely reverses.

Atlas pricing, tier by tier

TierSpec (per node)HourlyMonthly (3-node)
M102 vCPU shared, 2 GBabout $0.08about $58
M202 vCPU shared, 4 GBabout $0.20about $146
M302 vCPU, 8 GBabout $0.54about $394
M404 vCPU, 16 GBabout $1.04about $759
M508 vCPU, 32 GBabout $2.00about $1,460
M6016 vCPU, 64 GBabout $3.95about $2,884

Atlas hourly rates cover the full three-node replica set, a baseline of storage, continuous monitoring, and automated failover. Backups are billed separately: continuous cloud backup runs about $1.00 per GB-month for the snapshot store plus download charges, which on a 200 GB database with 30 day retention can add $150 to $250 per month depending on change rate. That backup line is the one most often missing from comparisons.

The self-hosted bill

Line itemConfigurationMonthly
Instances3 x m6i.large at $0.096/hrabout $210
Storage3 x 100 GB gp3 at $0.115/GB-moabout $35
Snapshots200 GB EBS snapshots at $0.05/GB-moabout $10
Cross-AZ replicationabout 1 TB/mo at $0.02/GB round tripabout $20
MonitoringMetrics, logs, alertingabout $25
Total infrastructureabout $300

So the comparable Atlas configuration at roughly $394 plus backup against roughly $300 self-hosted. Add Atlas continuous backup at $150 and the gap widens to about $244 per month, or $2,928 per year. That sounds worth chasing until you price the work.

The labour line

A self-hosted replica set needs: version upgrades (MongoDB ships a major release roughly annually and supports each for a few years), OS patching on three hosts, TLS certificate rotation, backup verification with periodic restore drills, oplog sizing, index build coordination, failover testing, and an on-call rotation that knows how to resolve a stuck primary election at 3am. Call it eight hours a month in steady state and a multi-day project once or twice a year.

At a fully loaded engineering cost of $200,000 per year, roughly $96 per hour, eight hours a month is $768. The $244 infrastructure saving does not come close. The break-even point sits at roughly 2.5 hours of operational attention per month, which is not a realistic steady state for a production replica set with an on-call obligation attached.

Where self-hosting genuinely wins

The economics invert at scale, for three reasons. First, Atlas tiers are fixed shapes; if your workload needs 128 GB of RAM and two vCPUs of compute, you buy an M80 and pay for CPU you do not use, whereas self-hosting lets you pick an r6i or x2gd shape matched to the actual ratio. Second, commitment discounts: three-year Reserved Instances or Savings Plans take 50 to 60 percent off EC2, a discount Atlas reserved capacity does not match at equivalent terms. Third, at high node counts the fixed operational cost amortizes: eight hours a month covers three nodes or thirty nodes at roughly similar effort with good automation.

A concrete inversion point: at M60 scale, about $2,884 per month, the equivalent self-hosted setup on three r6i.2xlarge instances is about $1,105 on-demand and roughly $500 with a three-year commitment. Even adding $1,000 per month of engineering time, self-hosting saves over $1,300 per month. Somewhere between M40 and M60, which is roughly the $800 to $2,000 per month range, the decision genuinely flips for a team that already has database operations capability.

The factors that are not money

Atlas gives you multi-cloud and multi-region deployment with a configuration change, online archive to cheaper storage, and a support relationship with the people who wrote the database. Self-hosting gives you control over the version, the storage engine configuration, the exact instance shape, and the ability to use Spot or Reserved capacity you already own. Neither of those columns converts cleanly to dollars, and both should weigh on the decision.

Whichever path you take, model it from Terraform before you commit so the storage copies, cross-AZ transfer, and backup retention appear in the estimate. Compare instance families against the resource catalog, and see self-hosted versus managed economics for the relational equivalent.

FAQ

How much does MongoDB Atlas cost?

Roughly $58 per month for M10 (2 GB), $146 for M20 (4 GB), $394 for M30 (2 vCPU, 8 GB), $759 for M40, $1,460 for M50, and $2,884 for M60, each covering a three-node replica set with baseline storage, monitoring, and automated failover. Continuous cloud backup is separate at about $1.00 per GB-month for the snapshot store, which on a 200 GB database with 30 day retention can add $150 to $250 per month.

How much does self-hosted MongoDB cost on AWS?

A three-node replica set on m6i.large is about $210 per month in instances, plus roughly $35 for three 100 GB gp3 volumes, $10 for snapshots, $20 for cross-AZ replication traffic, and $25 for monitoring, totalling about $300 per month. That compares to roughly $394 for an equivalent Atlas M30 before backups, or about $544 including them.

Is self-hosting MongoDB actually cheaper?

At small scale, barely. The roughly $244 per month infrastructure saving at M30 scale is consumed by about 2.5 hours of operational work at a loaded engineering cost of $96 per hour, and a production replica set with on-call realistically takes eight hours a month. At M60 scale the picture reverses: three r6i.2xlarge instances run about $1,105 on-demand or $500 with a three-year commitment against $2,884 for Atlas.

Where is the break-even between Atlas and self-hosting?

Somewhere between M40 and M60, roughly the $800 to $2,000 per month range, for a team that already has database operations capability. Three things drive the inversion: Atlas fixed tier shapes force you to buy CPU you do not need at high memory, EC2 three-year commitments take 50 to 60 percent off, and operational effort amortizes across more nodes with good automation.

What operational work does self-hosted MongoDB require?

Major version upgrades roughly annually, OS patching across three hosts, TLS certificate rotation, backup verification with periodic restore drills, oplog sizing, index build coordination, failover testing, and an on-call rotation capable of resolving a stuck primary election at 3am. Budget around eight hours a month in steady state plus a multi-day project once or twice a year.

How does C3X help compare MongoDB hosting options?

C3X prices the self-hosted topology from Terraform, including the pieces easy to omit from a comparison: three storage copies, cross-AZ replication transfer, snapshot retention, and monitoring. Having those costed in the pull request gives you an honest infrastructure number to weigh against the managed tier price, rather than a comparison that counts instance hours and forgets everything around them.

What to do next

Cost the whole topology, not just the instances. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.

Try C3X on your own Terraform

Free and open source. No API key required. One command to install, one command to estimate.