I need to implement storage functionality in my Ionic app and a bit confused about which library to use. It’s also because of my lack of my proper knowledge. So just wanted to check with you guys on the preferred way of implementing this in the industry.
I have come across SQLite, LocalStorage or App Preferences. But not sure what I should use.
I did read in some forum that if we install SQLite and code our app using ionic-storage, it will internally use the installed SQLite. Is it true and is it recommended?
Would appreciate if you could please give some insights.
I can’t think of a single situation in which localStorage is the best choice. It is not guaranteed to persist at all, so anything you would be tempted to put in it should either go somewhere that is or just in a transient service provider.
In that case, do you think it’s the best way to go about it? And if I do it this way, I can use the SQLite as key-value store by using ionic-storage or directly as a relational DB. Right?
It is well integrated and works pretty good.
If it is the right one for your depends on your other requirements… if it is just about a login token: Yes.
Yes, add Ionic Native SQLite into the mix and you can also use the relational part. But there will be no connection between the two areas, for the app these are two totally different interfaces. Just in the background it’s the same data store.