| ▲ | mikeocool 15 hours ago | |||||||||||||||||||||||||||||||||||||
I am generally not onboard with the “all you need is SQLite” articles that pop up on HN regularly. 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. | ||||||||||||||||||||||||||||||||||||||
| ▲ | vanschelven an hour ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||
Yes very much so! Also has the happy side-effect of making your architecture so much simpler to reason about[0] 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. | ||||||||||||||||||||||||||||||||||||||
| ▲ | dewey 3 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
I actually always find SQLite more annoying than Postgres. Postgres I just run on the host and let all my containers talk to the same instance, one thing to backup. With SQLite it's always about volumes, permissions, backing up individual files for multiple projects. 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. | ||||||||||||||||||||||||||||||||||||||
| ▲ | solid_fuel 14 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
I would rather keep things on postgres but everything wanting its own postgres container is really annoying. Postgres already has support for multiple databases, users, and access controls. I would personally prefer to just set up one postgres instance with proper backups and have everything run against that, unfortunately some self-hosting projects have fairly poor support for that. | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
| ▲ | a10c 11 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
Immich uses postgres because it relies on VectorChord for smart search. It's what powers the ability to search your photos for "a dog on a beach". It's also a fairly sensible decision. | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
| ▲ | skrtskrt 15 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
SQLite has a bunch of cool stuff happening around it right now too like Turso and Litestream. | ||||||||||||||||||||||||||||||||||||||
| ▲ | IllIIlIlIlIIIIl 11 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
> several things each wanted their own Postgres container. Immich wants a Postgres and a redis instance. 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. | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
| ▲ | 4ndrewl 3 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
Wanted their own postgres container or database? Why should the service know/care how postgres is running? | ||||||||||||||||||||||||||||||||||||||
| ▲ | Gigachad 15 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
How do backups work with SQLite? Postgres is nice in that it can run them live without any corruption issues for writes in the middle of the backup. | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
| ▲ | Larrikin 14 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||
My experience with this is that all of the projects that are worthwhile, continue to grow and then at some point some kind of bottleneck is hit. Migrations become slow or overly complicated, lookups start taking forever, etc and the app just starts to slowly become unusable the more you try to use it. 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 | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||