News for hackers. Stuff that matters.
Re:Ask HN: Who operates at scale without containers? by mamcx on Tuesday March 22, 2022 @03:20PM (#30770286)
Any hints in how use nix with DBs?

I have a semi-docker setup where I stay with the base OS + PostgreSQL and the rest is docker. But that means that upgrade the OS/DB is not that simple.

I tried before dockerize PG, but still the OS need management anyway and was harder to use diagnostics/psql/backups with docker....

Re:Ask HN: Who operates at scale without containers? by smilliken on Wednesday March 23, 2022 @12:13AM (#30774868)
Yeah, we built a tool for managing postgresql databases with nix. It's called schematic: https://gitlab.com/deltaex/schematic

We've been using it in prod for a couple years. There's a couple dozen production deployments outside the company as well. It's open source, MIT licensed. It doesn't have documentation yet, so it's currently only for people that don't mind reading the source or have talked to us directly about it.

It uses Nix because postgresql has C extensions, which can depend on anything in the software universe. Schema depends on extensions, so it's not technically possible to separate schema migrations from Nix without duct tape abd glue. So schematic is a sort of "distribution" of PostgreSQL that has a package manager (for extensions, schema, content, etc), and manages revisions.

If this is interesting to others here, I can do a "Show HN" post after getting the docs in order.

Re:Ask HN: Who operates at scale without containers? by mamcx on Wednesday March 23, 2022 @12:17AM (#30774891)
Yeah, managing the DBs is the major complications on doing this. A little discrepancy in binaries are not that always problematic, but a fail on the DB is catastrophic :)