5 ms·
Litestream didn’t exist until late 2020, meanwhile postgres has existed for decades. Moreover, SQLite requires the place you run your application to have durab
by hamandcheese 4y ago
Litestream didn’t exist until late 2020, meanwhile postgres has existed for decades.
Moreover, SQLite requires the place you run your application to have durable storage, which is a huge departure from the status quo.
It’s definitely neat, but the stack as a whole doesn’t strike me as mature enough to replace Postgres just yet.
- ngrilly 4y ago> SQLite requires the place you run your application to have durable storage, which is a huge departure from the status quo. Having durable storage used to be the status quo for decades. It changed only recently with cloud providers (or their customers) pushing for stateless workloads because they are much easier to manage in a distributed system than stateful workloads.
- zie 4y agoSQLite has been around for a very long time, it is easily the worlds most deployed SQL database. Litestream is just a way to do live sync/replication to make HA easier. There are certainly use cases where SQLite is not a good fit. There are likewise use-cases where PostgreSQL is not a good fit either. One is not better than the other, it just depends on your particular needs for that particular project. My point is, SQLite is a totally sane and reasonable storage/DB solution for many server side applications as well.
- tptacek 4y agoYou're writing this as if LiteFS and Postgres were basically the same thing, and the selection criteria just boils down to the Postgres pedigree and maybe all the Postgres-specific SQL features. But that's not the case at all. The difference between replicated SQLite and Postgres is that SQLite is in-core: it doesn't have to round-trip on the network to fetch data; it can burn through a large set of N+1 queries faster than Postgres can handle a single select. The difference is that SQLite is much faster. You sacrifice things to get that speed (Postgres features, set-and-forget write concurrency). Nobody is saying there's no reason to use Postgres, or maybe even that Postgres is the right call most of the time. But the idea that SQLite is rarely appropriate for concurrent serverside applications? It's received wisdom and it's wrong. Somebody across the thread actually suggested that WordPress was an example of the kind of application that SQLite wouldn't work for, that needed an n-tier database. (Leave aside the fact that WordPress doesn't support SQLite, has instead a longstanding MySQL dependency). WordPress! WordPress is a perfect example of a concurrent serverside application that probably should almost exclusively use SQLite. As I said in a different comment: the whole movement towards static site generators is, in large part, a reaction to how bad n-tier databases are for a very large, popular class of concurrent serverside applications.
- hamandcheese 4y agoMy second paragraph was specifically talking about the gigantic difference between operating a stateful application vs. a more typical stateless app + stateful DB. Most people aren’t deploying to Fly.io (yet!), so making Litestream work sounds pretty high risk to me :) combined with the lack of pedigree I led with, I just don’t see litestream as a good answer to “I need a HA database solution” for most people.
- tptacek 4y agoLitestream isn't a Fly.io feature.
- hamandcheese 4y agoNo, but the ability to deploy it on stateful containers is.
- tptacek 4y agoI'm sorry, I don't understand any word of that sentence (for instance: we don't run containers?). We sponsor Litestream and LiteFS (in the sense that we pay Ben to work on it full time), but no part of Litestream is baked into or in any way coupled with our platform. If you can run Litestream on Fly.io, you can run it anywhere else.
- hamandcheese 4y ago> for instance: we don't run containers? You "transmogrify container images into Firecracker micro-VMs" - surely you knew what I meant? And there is no denying that fly.io is a _particularly_ well suited platform to run stateful SQLite apps (with or without Litestream), since fly makes running stateful applications easy. I think thats awesome. I'm really confused why you seem to be trying to distance yourself from that, and why you are latching on so hard to my passing mention of fly. I wasn't making a dig, just pointing out that most people are stuck with (arguably worse) platforms that don't lend themself to stateful, "in-core" databases.