Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 563
rnella01 Avatar asked Jun 08 '10 22:06

rnella01


People also ask

Which can be used to store client-side user data?

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.

Why is it better to use IndexedDB instead of localStorage?

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.

When should I use IndexedDB?

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.

How do you store large data in the client-side?

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.


2 Answers

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.

like image 191
Rebecca Avatar answered Oct 10 '22 06:10

Rebecca


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.

like image 2
MrYukon Avatar answered Oct 10 '22 07:10

MrYukon