Live data from Hacker News

Ask HN: Do you self-host your database?

news.ycombinator.com

11–20 of 236 posts

Re: Ask HN: Do you self-host your database?

#11
Yes. I self-host for my infrastructure. MariaDB and PostgresSQL. I've been self-hosting MySQL and Postgress for nearly 15 years now. But it's not something I recommend my clients doing.You need to be really careful to avoid foot guns like the one that took down new blur. For example. I don't run my DBs in containers, although I run my applications within containers.

Re: Ask HN: Do you self-host your database?

#12

Self hosting PSQL via Docker container + Ansible. Also hosting MongoDB, Elastic Search, Redis instances (for session & caching, separate instances). Might consider researching using pg_bouncer later (but really not needed right now). Pricing and support for vendor solutions are too bad for small scale app.

> Pricing and support for vendor solutions are too bad for small scale app.

In-line with my experience too.

Where are some of the hard things that you learnt self hosting these many services?

Re: Ask HN: Do you self-host your database?

#14
post #4

We self-host a postgres cluster in k8s (AKS). The main reason being that the Azure postgres offering was not fit for (our) purpose. We did start with the Azure offering, and our default is generally to use the cloud offering.

Could you please elaborate on what the drawbacks with the Azure postgres offering are?

I am currently evaluating the same choice - Azure Postgres vs self-hosting in my k8s cluster.

Re: Ask HN: Do you self-host your database?

#15
Yes. A Postgres which is currently only 1TB in size. It's read heavy, the write workload is very low in tens to spikes of low hundreds per second whilst the read is in thousands per second. The workload is stable during traffic spikes due to app caching and CDN caching (for guests).

I do this for cost reasons, self hosting the database is so much cheaper than the managed options that for the same cost I can run the entire app stack, load balanced web servers, etc.

No containers anywhere but maybe in the future I'll add some.

Re: Ask HN: Do you self-host your database?

#16

Yes. I self-host for my infrastructure. MariaDB and PostgresSQL. I've been self-hosting MySQL and Postgress for nearly 15 years now. But it's not something I recommend my clients doing.You need to be really careful to avoid foot guns like the one that took down new blur. For example. I don't run my DBs in containers, although I run my applications within containers.

Makes sense.

How do you handle firewall? Just open up the source IP with the IP of wherever the Application is hosted?

Re: Ask HN: Do you self-host your database?

#17
IMHO self hosting your database (even in the cloud) is the best way to do it.

You have control over the version.

You have control over features.

You have control over performance.

It’s tons cheaper for greater performance - especially when you go over a few hundred gigs.

Yes, the hosted ones have built in replication - but my data is far too valuable to put in the hands of a third party. If they lost it - they could only shrug and say sorry and that’s it. The TOS indemnifies them.

I think it’s kind of honestly lazy — to not take the management of your data in your hands if you run a database of any significant size.

That being said, we do replicate and backup 9 ways to Sunday.

Re: Ask HN: Do you self-host your database?

#18
No. Unless your business is hosting databases for people your time can be better spent delivering real business value. Draw yourself a Wardley Map of the services in your product and you will see the place you should be spending time on is delivering features that the customer values not building copies of commodity services.

Re: Ask HN: Do you self-host your database?

#19
I wonder if it is a good deal or not. But i Host m' own Virtuoso instance, an open source DB for graph data, with a 200GB .dB file. Plus an Elastic with roughly 500GB of data. On a OVH dedicated instance, with 128GB RAM. All that for something like 1100€/year.

Would a hosted service be a better Idea, in your opinion? (That machine also has a LAMP stack for some of my web stuff).

Re: Ask HN: Do you self-host your database?

#20
post #9

Self-hosting MariaDB with multi-master replication. Works pretty well for my cases. Have a friend that was surprised by the AWS pricing changes on Aurora (they charge per query now instead of bandwidth/usage?)

multi-master with conflict resolution is non-trivial. Do you have automated failover set up? Also, didn't know about Aurora's per query pricing. That is crazy.

It's been a while since I ran MySQL in prod, but a multi-master setup where all writes go to one of them (and other is set to read-only, and your grants respect read-only) is super operable. If you have your config layer key off of read-only status and you kill existing client connections when you switch from read-write to read-only, it's a pretty small effort to switch masters.

I tend to leave the decision to switch masters to humans, and just automate the process. Unless you have bulletproof conflict resolution/reconciliation, automating failover is inviting a conflict that leads to major pain and a large effort to fix. Better to have a few minutes of write downtime while waiting for someone to make the decision (which includes making sure the dead host is truely dead and not just split brained)

Post reply on HN