Chetan
Chetan

Reputation: 5095

What will be a good choice for storing chrome app data locally among IndexedDB and File System?

I am trying to develop a chrome app which will store data. Data storing will be unlimited. I have two options to use Indexed DB and File System.

Which would be a good choice for data storage among the above two

Upvotes: 3

Views: 605

Answers (1)

kailniris
kailniris

Reputation: 9546

Using File System API to store data in the user PC is a bit problematic because you can't do it without the user approval. So my suggestion is to use indexedDB with the following permissions in your manifest:

"permissions": [
   "unlimitedStorage",
   "storage"
]

Basicly you can store anything in indexedDB the only problem with it its a bit slow and the API is a mess but there are lots of tutorials out there. I use it by myself for an offline first app. Its a bit hard to use but reliable way to store persistent data.

Another thing worth to note if you want to store key value pairs like settings for your app you can use chrome storage API with is the basic local storage API but chrome app exlusive.

Useful reading: https://developer.chrome.com/apps/offline_apps

Upvotes: 3

Related Questions