benbjohnson/postlite

Drop in replacement for Postgres?

adyanth opened this issue · 2 comments

This project looks very interesting and promising! Thanks for bringing this idea out.

I have a couple of questions after going through the README.

  • Is this only targeted at making remote management easier, or can it be used as a drop in replacement for Postgres?
  • How would the performance be like?
  • Can multiple clients connect and issue transactions?
  • How is user authorization taken care of?

Sqlite does not perform well over NFS due to file locking issues that is present with NFS. Using postlite on the NFS server to mitigate that problem would be a humongous value addition from this project.
Edit: I see that you also have worked on Litestream! You don't need me to tell you this :)

If it can perform reasonably well (not expecting production grade due to the backing store being sqlite), I can see this being used as a central database server (or even a DBaaS) for many homelabs too :)

Postlite isn't intended as a drop-in replacement. There's a lot of differences between SQL in SQLite versus Postgres and I'm not sure you get much (if any) benefit by using SQLite over a network for regular usage as opposed to Postgres alone. Good questions though. I'll do my best to answer them.

Is this only targeted at making remote management easier, or can it be used as a drop in replacement for Postgres?

Yes, it's only aimed at providing a shim for GUI tools so folks can remotely administer SQLite databases.

How would the performance be like?

Compared to local SQLite, the performance is probably atrocious. :)

Can multiple clients connect and issue transactions?

Yes, multiple clients can connect. It's still has the same constraints as SQLite so it'll support multiple readers and one writer at a time if it's in WAL mode.

How is user authorization taken care of?

It's not. There's a SQLite user auth extension that could be integrated but the assumption with Postlite is that you're running this on a private port that you're accessing either over SSH or Wireguard.

Makes sense. Thanks for taking the time to explain!