DEV Community

Discussion on: IndexedDB, something to rely upon?

Collapse
 
zimba profile image
Martin • Edited

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:

    • Delivering the app to the user is much easier. Chrome Web Store will take care of it.
    • Releasing new version and keep the app up-to-date is much easier (chrome will take care of it).
    • You can even sell the app with Web Store (paid apps).
    • Stable Api's and guaranteed to work with Chrome.
  • Cons:

    • If you're developing an internal tool or web app, then the delivering the app to user requires some effort.
    • Your app is tied to Chrome browser and the browser needs to be installed in the first place.
    • If you already built the app with some framework, then you need to modify the codebase to use chrome api.

2) Electron App

  • Pros:

    • You can use easily convert any modern web app into an Electron App.
    • Standalone app which doesn't depend on Chrome or any other browser.
    • If it's an internal tool to your company or you wanna monetize it in different way. Then this is the best option.
    • You're free to use any type of marketplace to distribute the app (like Apple App Store or Microsoft Store).
    • Stable Web Api, since your shipping the entire browser with your app.
  • Cons:

    • Delivering the app become painful (if you've couple thousand users) and you don't want to use App Store.
    • You need to have your own way to support payment if it's paid app.
    • You need to use build tools like webpack to build the electron app. if webapp is too simple (like plain html app), then it'll increase the complexity of the app.

All of these options (including yours) supports the both LocalStorage & Indexeddb storage.

Collapse
 
avalander profile image
Avalander

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.