Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 377
Chetan Avatar asked Dec 01 '25 09:12

Chetan


1 Answers

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

like image 198
kailniris Avatar answered Dec 04 '25 09:12

kailniris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!