What persistent data storages should i use?

To share my experiences…

I’ve had similar requirements to yourself (initial DB is 75Mb ish created from an existing sql database). I now have a working solution with an SQLite database. The solution and instructions on how to get it up and running are in this post Prepopulated SQLite Databases in Ionic - #6 by n40jpj

I have used SQL for all of my queries and the following plugin to get the database over to the device in the first instance : GitHub - an-rahulpandey/cordova-plugin-dbcopy: Copy SQLite Database from www folder to default app database location . I haven’t used an ORM, but that’s just because I haven’t looked to find one. I use EF and Hibernate heavily, but I like keeping my plugins to a minimum.

Regarding :

If I use the SQL database the same way I use localstorage , every time a relevant view is loaded the data is pulled from database will it increase the overhead as database calls will be made every time that view is loaded. ( Presently the data is pulled from localstorage. )

That really depends on your coding style and implementation, you can cache the page and or write a service to store some data in memory so that it only gets retrieved from the database when you specifically request it.

There are loads of tools out there for managing SQLite databases free and paid.

The above are my opinions only and suit my requirements, I am however more than happy to discuss better methods.

1 Like