I think this skips one mega benefit for apps. I’ve been using liteFS in production for a couple months. Your web app is able to resolve db queries instantly. You don’t need loading states if you’re using complex charts and other frontend JS that waits for data. All the data is resolved so fast and you can just return all your data like more traditional apps, and the load times are insane. If you’re multi region you c…
I think you always need loading states to account for slow network, or am I missing something?
Distributed SQLite: Paradigm shift or hype?
111–120 of 165 posts
Re: Distributed SQLite: Paradigm shift or hype?
#112Something I've been thinking about is partitioning my SQLite. Instead of storing all user's data in one mega table, what if I made a SQLite database for each user? Provided users never talk to each other, I think this might work?
Re: Distributed SQLite: Paradigm shift or hype?
#113Earlier quoted context omitted.
I'm pretty sure SQLite has covering indexes. And the relatively new strict mode should enforce at least basic types (though if you want to enforce your own rules for things like dates you're still on your own).
> I'm pretty sure SQLite has covering indexes. I checked to be sure I had not missed it, and didn’t find anything. You have expressions and conditions, but no covering. Obviously you can kinda emulate it by adding the columns you want to cover to the key, but… > though if you want to enforce your own rules for things like dates you're still on your own That’s what I was talking about, having richer types, and the abi…
Right, that seems like a good solution to me.
Re: Distributed SQLite: Paradigm shift or hype?
#114The paradigm shift that's going to come with distributed SQLite isn't to the edge, it's going to be to users devices. I believe the DX of building Local-first apps is going to hit the criticality point in the next year or so and its popularity is going to explode. With dynamic partial replication you can synchronise a subset of your database to a SQLite db on your users device, eliminating the network from the ui int…
Re: Distributed SQLite: Paradigm shift or hype?
#115I think "a few milliseconds" vastly understates this: if you want to run your application closer to users, even just across the US, each query is (at least) 70ms just to get over the network and back again.
"Application code spills into your database" was a bad thing when you wrote one language (say, Java, or PHP) and another language (PSQL/TSQL/etc) for your "stored procedures", but that's not what most modern databases are advocating for.
Instead, and not unlike something like React Server Components (RSC), you can choose whether to run code close to the user or closer to the DB (for transactions) in the same language as your application, because it's still part of your application code. This is the model that Durable Objects[1], our coordinated storage service, uses.
Disclaimer: I work on D1 & Durable Objects at Cloudflare, so I'm likely to be called biased here, but it's not like we haven't a) thought about this deeply and b) actually use D1 and Durable Objects to build distributed systems at Cloudflare.
[1]: https://blog.cloudflare.com/durable-objects-easy-fast-correc...
Re: Distributed SQLite: Paradigm shift or hype?
#116> While SQLite is a really amazing database, most teams will benefit from avoiding it and going the PostgreSQL way instead. > Bazillions of engineering hours have been spent to make Postgres the best backend database and choosing SQLite will inevitably force you to reinvent what Postgres already had for many years, in a fragile and buggy way. Could the same not also be said for MS SQL Server, Oracle, Sybase, MySQL, o…
> Rewrite that: "Bazillions of engineering hours have been spent to make XYZ the best backend database..." What you're saying (and what the author is saying) however is clashing with the reality of so many developers using sqlite and being happy with it. I'd suggest to rewrite it another way: > Bazillion of developers think they'll need a full-fledged database for their new project while sqlite will cover most of the…
Re: Distributed SQLite: Paradigm shift or hype?
#117> While SQLite is a really amazing database, most teams will benefit from avoiding it and going the PostgreSQL way instead. > Bazillions of engineering hours have been spent to make Postgres the best backend database and choosing SQLite will inevitably force you to reinvent what Postgres already had for many years, in a fragile and buggy way. Could the same not also be said for MS SQL Server, Oracle, Sybase, MySQL, o…
Without giving evidence, I do agree that Postgres is a better database that serves the general case better. I use both in production for different purposes, but postgresql makes a lot more sense then SQLite as our primary database
Re: Distributed SQLite: Paradigm shift or hype?
#118The paradigm shift that's going to come with distributed SQLite isn't to the edge, it's going to be to users devices. I believe the DX of building Local-first apps is going to hit the criticality point in the next year or so and its popularity is going to explode. With dynamic partial replication you can synchronise a subset of your database to a SQLite db on your users device, eliminating the network from the ui int…
You've been able to build these apps for years now, hell PouchDB was released in 2012. I don't think anything significant is going to push for more of these apps--the DX isn't really that great compared to remote write--there are more abstractions, less caching, way more corner cases, and I call BS on your conflict free utopia.
I don't think it's a dev problem, but a business one. No consumer is demanding local-first, and no company wants to give up that profitable data. We're doing it because we're purposely not interested in users' data and resiliency is part of our value—but we're still holding some of it for consumer convenience.
Re: Distributed SQLite: Paradigm shift or hype?
#119Earlier quoted context omitted.
> I'm pretty sure SQLite has covering indexes. I checked to be sure I had not missed it, and didn’t find anything. You have expressions and conditions, but no covering. Obviously you can kinda emulate it by adding the columns you want to cover to the key, but… > though if you want to enforce your own rules for things like dates you're still on your own That’s what I was talking about, having richer types, and the abi…
"Obviously you can kinda emulate it by adding the columns you want to cover to the key" Right, that seems like a good solution to me.
Re: Distributed SQLite: Paradigm shift or hype?
#120The paradigm shift that's going to come with distributed SQLite isn't to the edge, it's going to be to users devices. I believe the DX of building Local-first apps is going to hit the criticality point in the next year or so and its popularity is going to explode. With dynamic partial replication you can synchronise a subset of your database to a SQLite db on your users device, eliminating the network from the ui int…