Running databases in the cloud can be convenient, but it can also get expensive fast. For the Prosopo team, MongoDB Atlas was initially a fast, reliable way to run a cloud database, but as our data grew, so did the bills. Over the last year, we realised that we were spending thousands of dollars per month on infrastructure that we could run more efficiently ourselves. We explored various options but ultimately decided to migrate our MongoDB deployment to Hetzner, a cost-effective cloud provider.
Here's how we managed to cut our costs by 90% without sacrificing performance or reliability.
When we first started building, MongoDB Atlas was an easy choice. Everything was set up for us, and we could focus on building our application without worrying about database management. The free tier was sufficient for our initial needs, and as we grew, scaling up was as simple as a few clicks. However, scaling came with a steep price tag. We went from paying $0 per month for a small database to over $3,000 per month for a few hundred GBs of data. The cost breakdown before we migrated looked roughly like this:
Service Monthly Cost Atlas M40 Instance - AWS $1000 Atlas Continuous Cloud Backup Storage $700 Atlas AWS Data Transfer (Same Region) $10 Atlas AWS Data Transfer (Different Region) $1 Atlas AWS Data Transfer (Internet) $1,000 ❗ Total + VAT $3000+
The more keen eyed among you will have noticed the huge cost associated with data transfer over the internet - its as much as the servers! We're building Prosopo to be resilient to outages, such as the recent massive AWS outage, so we use many different cloud providers. This means that a lot of our database traffic goes over the internet, which is very expensive on MongoDB Atlas, due to it running on AWS (other options are available, but we chose AWS).
When your entire stack is on AWS, data transfer costs are minimal, as shown by the "Same Region" line item above. However, this architecture creates centralisation and single points of failure, which we want to avoid.
Oh, and even though we were paying this much, we didn't have access to any support! That's a separate paid plan.
Hetzner offered a compelling alternative:
High-performance dedicated servers at a fraction of AWS pricing
at a fraction of AWS pricing Predictable, flat-rate pricing without surprise bills
... continue reading