News for hackers. Stuff that matters.
Re:Just use Postgres for everything by kristiandupont on Saturday December 10, 2022 @12:52PM (#33934792)
Do you need (or at least benefit from) your database to run in-process? Because that is the only advantage I can see to SQLite over Postgres. Which makes it the better candidate in many places, but not for anything like a server.
Re:Just use Postgres for everything by freedomben on Saturday December 10, 2022 @12:56PM (#33934851)
For me it's maintenance. Sysadmin level of effort on a SQLite file is near 0
Re:Just use Postgres for everything by everforward on Saturday December 10, 2022 @03:31PM (#33936506)
I think this is true only if you're willing to give up resiliency.

You'll have to shut the app down to back it up. That problem gets worse if you want some kind of a cold standby, since backups should be frequent.

You could replicate it, but that requires running a separate daemon and starts to beg the "why not just have Postgres be the daemon?" question.

Sysadmin tasks start to get very difficult when someone starts with SQLite and expects to get Postgres-like features out of it. I'd rather run Postgres than try to replicate or continually back up SQLite.

Re:Just use Postgres for everything by spiffytech on Saturday December 10, 2022 @04:23PM (#33936955)
> You'll have to shut the app down to back it up.

This is not the case:

1) SQLite recommends using the official backup API, rather than copying files on disk. The backup API can be used while the app is running.

2) Litestream is the hot new tool on the block. It streams incremental DB changes to a backup stored on S3, for up-to-date point-in-time recovery.

Re:Just use Postgres for everything by beagle3 on Sunday December 11, 2022 @01:03AM (#33940547)
Adding to (1), you don't have to code anything to the backup API - the standard "sqlite3" command line has a ".backup" command that does it for you.
Re:Just use Postgres for everything by stingraycharles on Sunday December 11, 2022 @03:14AM (#33941271)
But how do you make sure a pool of web servers all have the same consistent view of your database?
Re:Just use Postgres for everything by freedomben on Monday December 12, 2022 @12:45PM (#33957654)
Oh yeah, if the app is big enough to have multiple replicas, I'll use postgres over sqlite. Mainly sqlite for me is for little apps/services. I do know people that have a setup for distributed sqlite, but IMHO when you want more than machine talking to the db, postgres is a much better fit.
Re:Just use Postgres for everything by jamal-kumar on Saturday December 10, 2022 @02:03PM (#33935631)
Yeah it's nice not to have to think too hard about that when you're trying to focus on a product getting shipped.

Plus, not everything is a public-facing website. It's amazing how little overhead it takes.

Re:Just use Postgres for everything by freedomben on Monday December 12, 2022 @12:48PM (#33957699)
> not everything is a public-facing website

exactly. single-node availability is often "good enough." when using sqlite for a simple service, I've cranked things out from first-line-of-code to production in 30 minutes. When the app only gets a hit every minute or so and only from internal traffic, no need for the overhead of a highly available service.

Re:Just use Postgres for everything by kristiandupont on Saturday December 10, 2022 @01:05PM (#33934951)
That's fair, though I've never done any sort of sysadmin on a Postgres server either..
Re:Just use Postgres for everything by luto on Saturday December 10, 2022 @12:53PM (#33934810)
It makes the dev setup trivial, since there is no database server around.
Re:Just use Postgres for everything by moron4hire on Saturday December 10, 2022 @01:15PM (#33935060)
Setting up postgres on the same machine is also trivial.

Modern, production-grade, web-scale machines are able to run more than one process, these days.

Re:Just use Postgres for everything by aiwv on Saturday December 10, 2022 @02:46PM (#33936069)
Sure, but an embedded database is still simpler than client/server. For many tasks, postgres does not offer any meaningful benefit over sqlite so why add the complexity?
Re:Just use Postgres for everything by antifa on Sunday December 11, 2022 @08:39PM (#33949846)
I've never worked on such a project that didn't benefit from postgres, but if I did, I would still use postgres because upgrading from sqlite to postgres, and learning a second SQL dialect, and converting a SQL between dialects sounds like a useless nightmare that costs me nothing to avoid.
Re:Just use Postgres for everything by CoolCold on Monday December 12, 2022 @04:55AM (#33952863)
I feel it's modern hype on lonely/indie/solo developer creating new thing which changes the world. Not caring on "complex" things till the project reaches 1 request per minute and finally have some data to be lost, is totally fine with this goal/scale.