If you need to store more data, why not do it on the server? What are the use cases for having a full-blown relational db client-side?
If you need to store more data, why not do it on the server? What are the use cases for having a full-blown relational db client-side?
So is PHP according the infallible SV pundits.
> it's also unnecessary, as you can store a significant amount of data in localStorage and the API is extremely simple to use.
Either you've never actually tried to store significant amounts of data in localstorage, or you're from the era of "640k is enough".
To say nothing of having no indexing functionality with localstorage, or paying the 33% base64 tax to put anything remotely binary into it.
> If you need to store more data, why not do it on the server?
"Because there is always, ALWAYS a high speed, low latency 100% uptime connection" /s
In answer to your last question, we have developed two PWAs reliant on local databases.
1. Was a product catalogue for use in stores, letting users filter down to select a particular appliance. two key requirements were that not all stores had great wifi coverage, and they wanted to easily update the catalogue (which meant no app recompilation).
So, Dexie atop IndexedDB, with indexes on the various facets for searching, and a simple settings page to run a sync. Dexie stored the product data, and a "immutable" SW cache strategy was used to keep the images available.
2. A detailed report generation app, Key requirement, must work with patchy connectivity as reports need to be taken in the field with unknown signal availability. Reports are locally stored and synced periodically (connection permitting). Again, Dexie atop IndexedDB, this time the images stored in the db as blobs prior to upload.
Sarcasm is unnecessary but I'll admit that so is the word "cancer".
Your first example is a great one, although the catalog would have to be really huge to not fit in memory; and since it is static (the users don't update it) it can be upgraded by downloading a json file regularly?
The second example doesn't explain why you would need a relational db.
Anyway my point is not to second guess applications that run well, and even less to argue with people who have already mastered IndexedDB -- good for them!
My point is for people on the fence to take a good, hard look at what's possible with localStorage and make sure that before they embark on the IndexedDB voyage, they are absolutely, positively certain that they have no other choice.
I recently came across an app that stores a couple of user preferences on IndexedDB; the funny part is that the comments complain for paragraphs about its quirks and general unpleasantness. The time spent complaining in the source would have been better spent switching to localStorage.
Irrelevant, nobody is forced to use PHP as a server side technology. On the other hand, browser API are limited with what browser vendors implement, so there is no choice.
Easier / cheaper to host only static files.