Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Cool hack, getting fork-per-connection postgres running with no kernel is quite interesting

I'm struggling to see the use case for minipg itself. For embedded or in-process postgres there's pglite as mentioned in comments. For dev/test parity there's embedded-postgres (go, java, node, python), which downloads native binaries and gives you a throwaway postgres with no docker. These by themselves cover what most people would want from "sqlite-style postgres," without the hypervisor layer or significant slow down.

Is minipg intended to become a real tool, or is it mainly a showcase for h9, with Postgres as the hard case that proves it works?

 help



I was confused about the use case as well but the authors blog post linked in this thread clears it up. I'm not sure I agree with it, personally would just run WASM postgres:

  > So when you find self-hostable open source software you'd like to run on your own computer, it can be daunting when it says it requires Postgres. Now you're responsible for setting up a database and getting it ready for the software to use.

  > Sure, you can run Postgres in Docker, and plenty of projects recommend it. But now you have two dependencies. If you don't already have Docker, you have to install it, which can mean a VM and a daemon on your machine. Then you have to run Postgres in it and make sure it's running whenever you use the software. That's a lot just to try something you don't know you want yet.

  > Wouldn't it be great to have the SQLite   experience, but with Postgres?

  > That's miniPG . It isn't Postgres as a library. There's already a WASM project for that, reasonably called PGlite. miniPG is closer to the SQLite CLI

The answer is in there, but I think you're referencing the wrong part of the post. The real kicker was PGlite not being able to be a drop-in replacement for an application expecting multiple connections/sessions, where it might need to query while in a separate transaction.

I just don't understand what's daunting about apt install postgresql

I hate people that recite credentials, but suffice to say I'm very familiar with postgres at-scale in production. I can give details if that's not compelling.

I still don't use postgres for my small projects, because sqlite gets you so far, so fast. You can just apt install postgres, but then you have all the aux questions:

    When do you upgrade?
    How is authentication handled?
    How are we doing backups?
    How do I deploy in production?
    How do I restore from a backup?
With sqlite, these are either not as relevant or they have trivial answers. With postgres, each is another project/process to track.

But of course, the way you frame your question sides-steps these challenges, and instead focuses on how to install the software, which was never the challenge being tackled.


The question was for self hosting though. So not at scale.

So upgrade when you're working in your stack and upgrading things. Auth using Unix socket as per defaults Backup by backing up your whole server

Is any of this quite sufficient for at scale? Often not, I agree. But that wasn't the context of the question.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: