True, but I can't help but feel dirty by submitting to the implicit complexity of containers, daemons, servers, etc. Maybe I've just never experienced the need for any of that and I'll be eating my words when I have to truly scale, but all other things being equal, nothing beats the simplicity of a simple ASGI app and an embedded database. There's so much fewer things in the stack that might crap out.
I mean I'm also the kind of person who salivates over stuff like chess engines that fit into a bootsector so there's that
That's fair. On the flip side, having spent the effort to spin up the container hosting and management guff, the ability to be sitting in a meeting, have someone say 'we should evaluate X app', and five minutes later have someone say 'oh, X.dev.company.com is up for you to have a look at' is pretty neat.
Sure, I am not saying one should not use postgres. Only saying that SQLite typically requires nothing to set up, while postgres does need to take a bit of time or use some kind of container (which tend to be an heavy setup too !)
I don't install postgres on any of my machines and only use docker images. It literally takes no work. Just a docker run blah blah.
Of course normally I have a docker compose for dev environments because I need redis and run multiple copies of my app so I just put another service in there for postgres.
For 90% (production or dev) of your needs that's all you need. If you want to tweak the config you can. No big deal.
You just described my exact practices as well. I always make sure to have directories for each container, and a .env and compose file for each in that directory which I import into the main compose file.
Lately I have been trying devcontainer setups using docker compose. So far pretty good luck but there are some annoying things with devcontainers I am trying to figure out how to mitigate.
Okay thanks. I've set a few up for not-very-complex purposes and wasn't sure if I just skipped a lot or something. I don't remember it taking too much time.
There are both cloud and local environments where getting a psql DB is a few clicks, and some monthly cost, be it time for maintaining, or money for someone else to do that for you.
I mean, it is not complicated either, you can just follow the startup guide or whatever. Running a docker image is also a good option. But compared to the nothing to do from SQLite, it is still something.
Biggest thing that has an important impact esp if coming from Microsoft SQL is case sensitivity out of the box Microsoft SQL is case insensitive for queries, postgres is case sensitive. You need to use collations mainly to deal with that issue.
this is not applicable to everyone, but I usually seem to run out of connections when running 10+ apps on a single pg instance so now I always crank up the max connections to 1000 (from 100)
40
u/thuiop1 Sep 10 '24
Postgres demands more setup.