Is it recommended to use the Web SQL Database for storage on the client side

10,308

Solution 1

9 months after this question was posed and the Web SQL Database is "..no longer in active maintenance and the Web Applications Working Group does not intend to maintain it further": http://en.wikipedia.org/wiki/Web_SQL_Database.

If you are developing a solution for release next year (especially mobile) then IndexedDB is the better option. If you need coverage now (excluding Firefox), then you can use Web SQL Database or serializing JSON objects into LocalStorage.

Solution 2

This is an older thread but I wanted to put my 2 cents in. As of today we're developing iOS web applications for Safari with the existing Web DB API. I haven't seen any indication that Safari is going to drop this in future releases, however since these apps must be used today on iPads, we're taking a calculated risk, and we'll be prepared to move to the IndexedDB if/when necessary.

Solution 3

It looks like WebSQL is on it's way out, to be replaced by IndexedDB support. Firefox and Internet Explorer have no plans to support WebSQL, they want to implement IndexedDB for Firefox 4 and IE9. Chrome is busy implementing it to, I'm sure Opera and Safari will follow suit.

Currently all HTML5 capable browsers (and some IE versions) support LocalStorage which is a simple key/value database that can only store strings, so if you need more structured storage capabilities, you'll have to wait until the end of this year (approx) for broad IndexedDB support.

Solution 4

I think in a use case like this (mix of online and offline), one would need to consider data synchronization as well (between the fruit of offline work stored locally, and the bulk of work presumably stored in the server for the mainstream online case). Apparently, neither option addresses this.

Share:
10,308

Related videos on Youtube

rnella01
Author by

rnella01

Updated on April 24, 2022

Comments

  • rnella01
    rnella01 about 2 years

    The use case is to have an application store data on the client side when offline. Is it advisable to use the Web SQL Database (which Chrome and Safari support, not FF though), or wait for the browsers to implement the Indexed Database API?

  • rnella01
    rnella01 about 13 years
    i took the "serialize JSON objects to LocalStorage" approach for now. Will definitely revisit IndexedDB approach once it is implemented by all the major browser vendors. For now i found this useful: goo.gl/kwaAU
  • rnella01
    rnella01 about 13 years
    looks like IndexedDB is now supported in the latest version of the browsers, it is probably time to experiment with it and share some experiences...
  • rnella01
    rnella01 almost 13 years
    In our case we built a javascript framework that takes care of the synchronization when the user logs into the system when online.
  • oligofren
    oligofren over 10 years
    @mella01 indexeddb is not supported on current mobile browsers. the exception being BlackBerry 10 (of all things!). Ref: caniuse.com/#search=indexeddb