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

六月ゝ 毕业季﹏ 提交于 2019-12-23 07:11:32

问题


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?


回答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.




回答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.




回答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.




回答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.




回答5:


If you need Firefox support, then obviously no.



来源:https://stackoverflow.com/questions/3001657/is-it-recommended-to-use-the-web-sql-database-for-storage-on-the-client-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!