Live data from Hacker News

We cut our Mongo DB costs by 90% by moving to Hetzner

prosopo.io

181–190 of 214 posts

Re: We cut our Mongo DB costs by 90% by moving to Hetzner

#181

> Here's how we managed to cut our costs by 90% You could cut your MongoDB costs by 100% by not using it ;) > without sacrificing performance or reliability. You're using a single server in a single datacenter. MongoDB Atlas is deployed to VMs on 2-3 AZs. You don't have close to the same reliability. (I'm also curious why their M40 instance costs $1000, when the Pricing Calculator ( https://www.mongodb.com/pricing )…

At FastComments we have Mongo deployed across three continents and four regions on dedicated servers with full disk encryption, across two major providers just incase. It was setup by one person. Replication lag is usually under 300ms.

Re: We cut our Mongo DB costs by 90% by moving to Hetzner

#182

OK guys, running on a single instance is REALLY a BAD IDEA for non-pet-projects. Really bad! Change it as fast as you can. I love Hetzner for what they offer but you will run into huge outages pretty soon. At least you need two different network zones on Hetzner and three servers. It's not hard to setup, but you need to do it.

I have a website with hundreds of thousands of monthly visitors running on a single Hetzner machine since >10 years (switched machines inside Hetzner a few times though).

My outage averages around 20 minutes per year, so an uptime of around 99.996%.

I have no idea where you see those "huge outages" coming from.

Re: We cut our Mongo DB costs by 90% by moving to Hetzner

#184
post #48

Atlas is plain robbery. I see companies paying 600K USD/month on a few clusters, mostly used for testing. The problem is they got locked into this, by doing a huge migration of their apps and switching to a different tech would easily take 2 to 5 years.

I’ve seen this happen many times. It looks cheap and easy to spin up, then it grows out of hand and they kill you on the renewals.

Re: We cut our Mongo DB costs by 90% by moving to Hetzner

#185
post #89

Earlier quoted context omitted.

I think you're being overly dramatic. In practice I've seen complexity (which HA setups often introduce) causing downtimes far more often than a service being hosted only on a single instance.

Yes, any time someone says "I'm going to make a thing more reliable by adding more things to it" I either want to buy them a copy of Normal Accidents or hit them over the head with mine.

Normal Accidents https://en.wikipedia.org/wiki/Normal_Accidents

Re: We cut our Mongo DB costs by 90% by moving to Hetzner

#186

MongoDB Atlas was around 500% more expensive than in-house every time I evaluated it (at almost every scale they offer as well). They also leaned too heavily on sharding as a universal solution to scaling as opposed to leveraging the minimal cost of terabytes of RAM. The p99 latency increase, risk of major re-sharding downtime, increased restore times, and increased operational complexity weren't worth it for ~1 TB d…

That's because sharding is way more likely to make them more money with their licensing model.

Re: We cut our Mongo DB costs by 90% by moving to Hetzner

#187
post #151

Earlier quoted context omitted.

You'll have planned downtime just for upgrading MongoDB version or rebooting the instance. I don't think that this is sth you'd want to have. Running MongoDB in a replica set is really easy and much easier than running postgres or MySQL in an HA setup. No need for SREs. Just add 2 more Hetzner servers.

The sad part of that is that 3 Hetzner servers are still less than 20% of the price of equivalent AWS resources. This was already pretty bad when AWS started, but now it's reaching truly ridiculous proportions. from the "Serverborse": i7-7700 with 64GB ram and 500G disk. 37.5 euros/month This is ~8 vcpus + 64GB ram + 512G disk. 585 USD/month It gets a lot worse if you include any non-negligible internet traffic. How…

Sure, I am not against Hetzner, it's great. I just find that running sth in HA mode is important for any service that is vital to customers. I am not saying that you need HA for a website. Also, I run many applications NOT in HA mode but those are single customer applications where it's totally fine to do maintenance at night or on the weekend. But for SaaS this is probably not a very good idea.

Re: We cut our Mongo DB costs by 90% by moving to Hetzner

#188
post #101

Earlier quoted context omitted.

Personally I've found it faster to build using mongo cause you don't need to worry about schemas. You get 32mb per document and you can work out your downstream processing later, e.g. cleanup and serve to postgres, file, wherever. This data is a big data dump that's feeding ML models so relational stuff is not that important.

I used to build personal projects like this, but after Postgres got JSONB support I haven't found any reason to not just start with Postgres. There's usually a couple of tables/columns you want a proper schema for, and having it all in Postgres to begin with makes it much easier to migrate the schemaless JSONB blobs later on.

Their JSONB impl is not equivalent in terms of write isolation.

Re: We cut our Mongo DB costs by 90% by moving to Hetzner

#189

Earlier quoted context omitted.

You can look at this particular bill and observe that more than 50% of the cost was going to AWS.

If they’re a reseller of AWS, which they will be, they decide the rates that get charged.

Yes, and my point is that this customer switching to running their own MongoDB instances on EC2 like Atlas does would reduce the bill by less than 50% because the rates that they are charging mean that their cut is less than what AWS is getting from this customer.

Re: We cut our Mongo DB costs by 90% by moving to Hetzner

#190
post #87
post #59

Earlier quoted context omitted.

> many people just chuck something on us-east-1 and go Even dropping something on a single EC2 node in us-east-1 (or at Google Cloud) is going to be more reliable over time than a single dedicated machine elsewhere. This is because they run with a layer that will e.g. live migrate your running apps in case of hardware failures. The failure modes of dedicated are quite different than those of the modern hyperscaler cl…

It's not an apples-to-apples comparison, because EC2 and Google Cloud have ephemeral disk - persistent disk is an add-on, which is implemented with a complex and frequently changing distributed storage system On the other hand, a Hetzner machine I just rented came with Linux software RAID enabled (md devices in the kernel) --- I'm not aware of any comparisons, but I'd like to see see some It's not straightforward, an…

Anecdotal, but a year ago we lost the whole RAID array in a rented Hetzner server to some hardware failure.

In a way, I think it doesn't matter what you use as long as you diversify enough (and have lots of backups), as everything can fail, and often the probability of failure doesn't even matter that much as any failure can be one too many.

Post reply on HN