客户端是否建议使用Web SQL数据库进行存储

发布于 2024-09-05 00:41:52 字数 95 浏览 1 评论 0原文

用例是让应用程序在离线时在客户端存储数据。 是否建议使用 Web SQL 数据库(Chrome 和 Safari 支持,但不支持 FF),还是等待浏览器实现索引数据库 API?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

烟沫凡尘 2024-09-12 00:41:53

提出此问题 9 个月后,Web SQL 数据库“..不再进行主动维护,Web 应用程序工作组不打算进一步维护它”:http://en.wikipedia.org/wiki/Web_SQL_Database

如果您正在开发明年发布的解决方案(尤其是移动设备),那么 IndexedDB 是更好的选择。如果您现在需要覆盖范围(不包括 Firefox),那么您可以使用 Web SQL 数据库或将 JSON 对象序列化到 LocalStorage 中。

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.

聆听风音 2024-09-12 00:41:53

这是一个较旧的线程,但我想投入 2 美分。截至今天,我们正在使用现有的 Web DB API 为 Safari 开发 iOS Web 应用程序。我还没有看到任何迹象表明 Safari 会在未来的版本中放弃这一功能,但是由于这些应用程序现在必须在 iPad 上使用,因此我们正在承担经过计算的风险,并且我们将准备好转向 IndexedDB 如果/必要时。

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.

药祭#氼 2024-09-12 00:41:53

看起来 WebSQL 即将退出历史舞台,将被 IndexedDB 支持所取代。 Firefox 和 Internet Explorer 没有计划支持 WebSQL,他们希望为 Firefox 4 和 IE9 实现 IndexedDB。 Chrome 正忙于实施它,我相信 Opera 和 Safari 也会效仿。

目前所有支持 HTML5 的浏览器(以及部分 IE 版本)都支持 LocalStorage,这是一个简单的键/值数据库,只能存储字符串,因此如果您需要更结构化的存储功能,则必须等到今年年底(大约)将提供广泛的 IndexedDB 支持。

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.

指尖微凉心微凉 2024-09-12 00:41:53

我认为在这样的用例(在线和离线混合)中,还需要考虑数据同步(在本地存储的离线工作成果与主流在线情况下可能存储在服务器中的大部分工作之间) )。显然,这两个选项都没有解决这个问题。

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.

垂暮老矣 2024-09-12 00:41:53

如果您需要 Firefox 支持,那么显然不需要。

If you need Firefox support, then obviously no.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文