Where to store large and permanent offline data


#21

Thx!

I will revert to native File. and made a small switcher in the provider to Storage so I can test in the browser (although Chrome does support file write, I understood)

Regards
Tom


#22

You could try pouchdb with sqlite as backend storage … super simple to integrate into an Ionic app.


#23

That’s a very good question, I am also in initial stages of offline dictionary app. I didn’t considered the storage of the data yet. If the sql solution didn’t work I am planning to split up the data in different json. Don’t know how will it go.


#24

From the time I asked this question, I have checked other likely questions and answers. I have resolved and have started saving my static data in JSON files. It’s been going well. :slightly_smiling_face: after reading a few articles I have structured my JSON files in such a way that I can fetch data as needed per app interface.
I recommend making wider searches, you will definitely find helpful articles and code samples to help u with Using JSON data in ur ionic project


#25

can you explaine more please, Thanks


#26

I think that if you use IonicStorage directly, you can store JSON structures under a key. This can be useful for certain scenarios. But if you have to alter the data of those structures frequently, it is better to use sqlite directly, adding the items with their relationships and being able to call SQLite queries.

I havent found a good way to manage a lot of data, directly, with ionic storage and JSON. Whenever you write, under a key,

let data = [2,4,8,6,9,2]

storage.set(“test”, data)

If you want to modify that array, e.g, add one item, you need to load the key, modify the array and save it again. Which, whith a small array, it is not a problem. But if you are handling huge arrays or objects nested into other arrays/objects… it can be very slow to perform operations.

Unless someone tells me that I am wrong (and I would love to, because I would prefer a simpler way to access/manipulate data than with sqlite calls).