Hacker News new | ask | show | jobs
by bkovacev 554 days ago
While we are it - are there any good resources on how to best self host a Postgres database? Any tips and tricks, best practices, docker / no docker etc? I’m looking to self host a database server for my multiple pet projects, but I would love to get backups, optimizations and other stuff done well.
5 comments

I find this YouTube channel[0] has a great number of videos on how to setup Postgres on a regular Linux machine, explaining how configure it and make it work for high availability. It’s easier than you’d think.

[0] https://youtube.com/playlist?list=PLBrWqg4Ny6vVwwrxjgEtJgdre...

When I self host I lean towards SQLite simply because it’s simpler. In-place upgrades, trivial backups via Litestream, etc.

Postgres major version upgrades are the main reason I don’t self host it, though maybe I should rethink my position on that!

For backups, pg_dump is good and simple for starting out.

For tuning, postgresqlco.nf[1] is great.

[1] https://postgresqlco.nf/tuning-guide

Not the answer you were looking for, but I had been shopping recently for slightly overlapping reasons (I want to ship projects, but they are all smaller MVPs that might run for a while and I didn't want to pay for 1 database service for each one on Render).

I found https://www.thenile.dev/pricing which supports which apparently supports unlimited databases.

afaik:

On promise: Use containers but the data folder should be mounted volume

On cloud/k8s: Just use a managed DB, setting up a DB in k8s is hard because the filesystem