I am looking to find best practices for Angularjs data persistence on a PhoneGap app. I'm using Ionic Framework on top of this, but not relevant to this question as it is just built on top of Angular & Cordova.
I like that Angular remains flexible on data persistence solutions, it makes sense since it is a web framework not specifically a Hybrid app framework... would love to know how people are solving this.
Here's an overview:
I've been looking at the following options. Can you provide any feedback on any of these?
Sorry for the long post. I really would like to see some thoughts on best practices. Would love an Angular Way to handle large data persistence on Hybrid mobile apps.
Thanks
PouchDB dev here. Obviously I'm biased, but here's my take:
The best way to get around the storage quotas in PhoneGap/Cordova is to use the SQLite plugin for iOS/Android. The performance also tends to be better, especially on Android. (Edit: in modern post-Kitkat Android, it's actually worse.)
WebSQL has a nice query language, but you want to be future-proof, i.e., not chain yourself to a dead standard. There's also Windows Phone and Firefox OS to consider.
So if you use PouchDB and install the PhoneGap plugin, it'll work cross-browser and you'll avoid the storage limit on iOS/Android. Win?
Also, it's my personal experience that Angular fits with PouchDB like PB&J, since Angular deals with straight-up JSON objects and so does Pouch. (Compare this to Ember and Backbone, which have custom classes that you have to export to/import from JSON – it's a little trickier.)
Good luck with whatever you choose!