5 ms·
It's an alternative to using IndexedDB which is a browser provided API. On use cases, you can give your web app offline support by locally caching data in an S
by samwillis 4y ago
It's an alternative to using IndexedDB which is a browser provided API.
On use cases, you can give your web app offline support by locally caching data in an SQL database and have it be fully queryable.
Say you are building an app like Notion, they already have "offline mode" for the mobile and desktop apps, this would enable you to build that for the web app.
This is very much one of the final jigsaw pieces needed to make PWAs (progressive web apps) competitive for the majority of use cases. We just need Apple to catch up and fill in a few other blanks too.
A design pattern that is beginning to emerge is "offline/local first". You design your app to fundamentally work offline, using things such as this, and the server component only works to synchronise clients. It's a bit like the design move to "mobile first" that happed 10 years ago, but going to another level.
- wargames 4y agoI haven't used IndexedDB in a while.. but my recollection is that it is basically SQLite. Not sure I see the advantage of this above and beyond what IndexedDB is already providing. What are the pros and cons of each approach?
- actionfromafar 4y agohttps://nolanlawson.com/2021/08/22/speeding-up-indexeddb-reads-and-writes/ https://nolanlawson.com/2021/08/22/speeding-up-indexeddb-rea... IndexedDB seems like a whole bag of gotchas. SQLite + simpler browser provided file backing seems interesting to me.
- azangru 4y ago> but my recollection is that it is basically SQLite. SQLite, which has a SQL database engine, is, by definition, a relational database. IndexedDB is a non-relational, or noSQL, database. One can't be basically the same as the other :-)
- AndrewSChapman 4y agoIndexDb is not a relational data store. It's much closer to Mongo than it it to Sqlite. If you want relational tables, joins, aggregations etc, you want something like this (or the original Web SQL that was deprecated). There is definitely a use case for it.
- mr_toad 4y ago> It's much closer to Mongo than it it to Sqlite. If only. It’s much closer to DBM than it is to Mongo.
- simonw 4y agoOne is a key value store, the other is a full relational database. Think Redis vs PostgreSQL.
- phaedrus 4y agoSo thick client applications get the last laugh in the end? It reminds me of an old concept, that has a catchy name I can't recall, positing an endless cycle in systems evolution where local peripherals grow processing capability until someone notices and (re)centralizes it, only for the local processing capability to quietly begin growing again, and so on.
- maizek 4y agoFantastic, would love to know the name if you end up remembering. I see this pattern so often.
- Existenceblinks 4y ago"Offline/local first" sounds easy but it's the distributed problem. How is data be consistent?
- thruflo 4y agoYou can have transactional causal consistency with an AP system. Combined with CRDTs it’s very powerful. You also have mixed (“just right”) consistency systems and techniques to introduce and optimise the use of runtime coordination where necessary. For example see https://electric-sql.com/docs/reference/consistency https://electric-sql.com/docs/reference/consistency
- julianeon 4y agoIt feels like you're assuming that Apple is a student here that forgot to do his homework, as opposed to a miscreant who is trying to block progress on purpose. Apple wants to handicap web apps to encourage people to build for iOS.
- samwillis 4y agoThat may or may not be to some extent true, however I find negativity isn't generally the best way to encourage people to do something you would like. I think Safari has also made progress over the last couple of years, and there is indication of them being more receptive to PWAs. I'm going to cheerlead for that. It's also worth noting that the EU and UK competition authorities are looking at forcing Apple to make changes to some of their rules around web browsers on iOS. They have a big stick, I don't, hence my nicer words.