But I recently looked into self hosting and several things each wanted their own Postgres container. Immich wants a Postgres and a redis instance.
If you’re building apps targeted at self hosters, SQLite is really all you need.
But I recently looked into self hosting and several things each wanted their own Postgres container. Immich wants a Postgres and a redis instance.
If you’re building apps targeted at self hosters, SQLite is really all you need.
The getting started would be a lot different if it first instructed you to install postgres, run a script or create a database and users and configure access controls. Also certain things become easier if you assume you can also manage the postgres instance, like on an upgrade, maybe you just create a completely new database and drop the old one, or isolate tenants within one application into different databases, etc.
In general, I agree with OP that sqlite is all you need for selfhosted applications (most of the time at least)
A possible restore only affects that app. Plus I can guarantee the files and DB were snapshotted at the same moment this way.
It may just be a way for me to avoid managing the DB.
Does a DB fall apart every time that happens? It does happen, but I might argue it shouldn’t happen, especially in simple configurations.
I do have an automatic daily dump in case of emergencies.
Even in work environments for apps that likely won't have thousands of simultaneous users. Modern SSD drives are so fast that so many apps don't need the advanced features of a full blown rdbms. And I think options like Turso and Cloudflare D1 fill the in between as a hosted option.
I do wish that sqlite had a couple more native types, it works really well as it stands.
It's what powers the ability to search your photos for "a dog on a beach".
It's also a fairly sensible decision.
And for small enough vector sets, holding them in memory is reasonable. Most personal photo collections would fit that scale.
It also makes it much easier to just point my Postgres GUI client to my remote server (Behind Tailscale of course) and query the database there without copying over the SQLite file to my local machine, or mount it somehow. Even for simple projects that I start I always prefer Postgres.
Those things are dirt cheap. A Postgres container on my machine uses 200MB of memory. Redis is nearly free. It's a small price to pay to not have services cross paths with each other and mucking everything up.
You end up in a situation where you are following some complex guide (hopefully written by the actual developer) where you make a huge backup, have to tear everything down, and then hope the migration from SQLite or MariaDB doesn't hit any issues. Postgres is heavier but at the scales of self hosting it should not matter on any modern system. Multiple docker containers even on a Pi isn't something you have to worry about. Solutions like Immich are usually run on a NAS where there would never be an issue
In the "end" (after a couple of months actually) I did add support for MySQL and Postgres because I found it massively helps adoption for those self-hosters that already have those (and associated stuff, e.g. backups) in place.