ilight
ilight

Reputation: 1622

Alternatives to using Web SQL database for storing large amount of data in Phonegap app?

Problem Statement :-

1) The app is developed in Phonegap to support multiple devices (Android,iOS etc)

2) Currently using Web SQL database due to large amount of data

3) App will have to receive updated data and update its database, in the near future

Please suggest me an alternative way of storage to Web SQL database, for the above mentioned application.

As per my knowledge, a web service can be put up on the server side and JSON can be used to get and update the current SQL database. (have not used JSON in my life, so correct me if I'm wrong).

(OR)

Write a plugin for phonegap to store data in the device using some native calls.(limited knowledge here also). But will it work across multiple devices like Android-based and iOS-based?

(OR)

Can someone suggest how I proceed towards acheiving this without using html5-related stuff so that I can be able to browse the web source of the phonegap even on a normal non-html5-supporting browser?

Upvotes: 4

Views: 6266

Answers (2)

SashaZd
SashaZd

Reputation: 3319

I've already answered this question in the following post on StackOverflow. It should help you ::

Phonegap Offline Database

It will discuss all the common and favorite options available right now. And I've added in snippets of code, and covered all the pros and cons of each option.

Upvotes: 1

Devgeeks
Devgeeks

Reputation: 5647

One alternative to WebSQL is 'web storage' - http://dev.w3.org/html5/webstorage/

Although web storage is a simple key/value pair system, in combination with JSON strings you could store whole objects (basically serialising them using JSON.stringify() and deserializing them with JSON.parse()).

Here is an article that basically goes through the options available:

http://csimms.botonomy.com/2011/05/html5-storage-wars-localstorage-vs-indexeddb-vs-web-sql.html

A PhoneGap plugin would be another option, but it would just be an interface between say an SQLite DB and your JavaScript... this wouldn't be that much different to Web SQL.

Upvotes: 6

Related Questions