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?
Since the early days of the web, sites have used cookies to store information to personalize user experience on websites. They're the earliest form of client-side storage commonly used on the web.
Using localStorage requires creating many individual (in my case, dozens) key/value pairs. Instead, IndexedDB would allow storing an array or object of all form data together. This would make storage much easier and could potentially make retrieving the data much easier.
You might use IndexedDB to store structured data that's unrelated to any data on the server. An example might be a calendar, a to-do list, or saved games that are played locally. In this case, the application is really a local one, and your web site is just the vehicle for delivering it.
There are four main methods for storing large amounts of client-side data today: Web SQL, IndexedDB, Web Storage and Application Cache. The sections that follow examine each method individually and explore basic aspects of their programming and operation.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With