Could I build a Progressive Web App using IndexedDB as my sole form of storage?
My supposition is to build a suite of apps that work together and are local; calendar, tasks, contacts, etc that run exclusively inside the browsers domain. They don't need to install an 'app', they don't need a web service to function. Just go toa webpage, click add to desktop an like Dev.to and voila it works.
Can this be done? Why hasn't this become common? What are the risk factors?
More specifically, I'm clearly going to rely on IndexedDB, right? Is that bad/good? Why?
I'm sure there are reasons for why this hasn't happened, but if I could I'd like to aggregate all the feedback into this one article for myself and others who may be considering the same thing.
Your assistance is greatly appreciated!!
Top comments (5)
Why do you say it is not used?
Anyhow IndexedDB has a complicated API, even Mozilla suggests using a wrapping library:
Nice. Thanks for the tip.
By the way I know it's used per say, but what I'm saying is look at my examples and I don't see anything built like that. Not sure if I'm making myself understood or not.
Don't know, it's not easy to know how much IndexedDB is used. You would need to check web apps and see where they store their data. That's a daunting task :D
Checking the wrappers usage it would probably be easier:
someone must be using them :D
It's not very common because there are other better ways to achieve the same.
If wanna build an web app (or PWA) with offline storage, these are the options:
1) Chrome Apps
Pros:
Cons:
2) Electron App
Pros:
Cons:
All of these options (including yours) supports the both
LocalStorage
&Indexeddb
storage.It's worth noting that Google has deprecated chrome apps for desktop (except in chrome OS) and electron doesn't support mobile platforms, so those options don't cover all the use cases one might want for an offline web app.