Best data persistence for Angularjs/Javascript Apps on PhoneGap

Angular remains flexible on data persistence solutions, it makes sense since it is a web framework not specifically a Hybrid app framework... 
Here's an overview:

Requirements

  1. Add local database to app build for preloaded data. This will be over the 5MB data limit.
    • Load data from local database on startup.
    • Saving updated data to local data store for persistence.
    • Prefer schema-less if possible.
    • Simple query interface. I could load all the data into memory and just use standard Angular filters for this, provided the performance was decent.
    • Object query interface... something like an ActiveRecord-like ORM rather than having to write SQL in app.

Options

Options are following :
  1. Breezejs - Looks more focused on server. Breeze is a JavaScript library that helps you manage data in rich client applications. If you store data in a database, query and save those data as complex object graphs, and share these graphs across multiple screens of your JavaScript client, Breeze is for you.
  2. YDN-DB
  3. JayData - Concerned about commercial aspect of it.
  4. Persistencejs - This looks promising.
  5. ngStorage - Is this just a localStorage interface.
  6. Angular-cache
  7. localForagelocalForage is a fast and simple storage library for JavaScript. localForage improves the offline experience of your web app by using asynchronous storage (IndexedDB or WebSQL) with a simple,localStorage-like API.
  8. Pouchdb - concerned about query language. does not solve 5M restriction. Install the PhoneGap plugin, it'll work cross-browser and you'll avoid the storage limit on iOS/Android
  9. Couchdb Lite - concerned about query language.
  10. WebSQL - The initial limit will be 50mb. 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
  11. Indexeddb - There is a shim that builds compat-layer for most major browsers. The initial limit will be 50mb. The syntax will be really easy to use in your angular project. If I could use this on top of Sqlite that would prob be a winner for me since more standards based.
  12. Store in json file - Just use plain old objects and then use Phonegap file api to load and store serialized data. Seems like a pain to have to serialize all the data every time we want to save... but an option so long as we can use Angular filters.

Comments

Popular posts from this blog

Angular 4 + Cordova Boilerplate ::: Hybrid Mobile Application

In MVC 4 Save and Retrieve cookies