HTML5数据库的现状如何?

发布于 2024-10-12 23:45:13 字数 315 浏览 2 评论 0原文

该规范 http://www.w3.org/TR/webdatabase/ 说:

该文档位于 W3C 推荐轨道上,但规范工作已停止。该规范陷入了僵局:所有感兴趣的实现者都使用相同的 SQL 后端 (Sqlite),但我们需要多个独立的实现来沿着标准化路径前进。

这是否意味着 HTML5 数据库即将消失,并且在一段时间内我们将拥有使用 SQLite 的事实上的标准,可能会存在浏览器差异?或者 W3C 是否发布了完成该标准的计划?

This spec http://www.w3.org/TR/webdatabase/ says:

This document was on the W3C Recommendation track but specification work has stopped. The specification reached an impasse: all interested implementors have used the same SQL backend (Sqlite), but we need multiple independent implementations to proceed along a standardisation path.

Does this mean that HTML5 database is going away, and for some time we will have a de-facto standard using SQLite, possibly with browser differences? Or has the W3C published a plan of attack for finishing the standard?

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

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

发布评论

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

评论(3

乖乖公主 2024-10-19 23:45:13

根据这篇文章:

[...]我们认为有必要解释一下我们的设计选择,以及为什么我们认为 IndexedDB 是比 Web SQL 数据库更好的 Web 解决方案。

在另一篇文章中,我们将 IndexedDB 与 Web SQL 数据库进行比较,并注意前者比后者提供了更多的语法简单性。 IndexedDB 为第三方 JavaScript 库留下了空间,可以通过 BTree API 跨越底层原语,我们期待看到像 BrowserCouch 这样构建在 IndexedDB 之上的举措。勇敢的 Web 开发人员甚至可以在 IndexedDB 之上构建 SQL API。我们特别欢迎在 IndexedDB 之上实现 Web SQL 数据库 API,因为我们认为这在技术上是可行的。从与浏览器原语一起使用的基于 SQL 的 API 开始并不是正确的第一步,但在 IndexedDB 之上肯定还有基于 SQL 的 API 的空间。

我个人并没有被本文中提出的论点所左右,但很明显(目前)Mozilla 已经决定 Web SQL 数据库已死

关于本文的更多有趣评论可以在黑客新闻上找到。

According to this article:

[...] we think it is worth explaining our design choices, and why we think IndexedDB is a better solution for the web than Web SQL Database.

In another article, we compare IndexedDB with Web SQL Database, and note that the former provides much syntactic simplicity over the latter. IndexedDB leaves room for a third-party JavaScript library to straddle the underlying primitives with a BTree API, and we look forward to seeing initiatives like BrowserCouch built on top of IndexedDB. Intrepid web developers can even build a SQL API on top of IndexedDB. We’d particularly welcome an implementation of the Web SQL Database API on top of IndexedDB, since we think that this is technically feasible. Starting with a SQL-based API for use with browser primitives wasn’t the right first step, but certainly there’s room for SQL-based APIs on top of IndexedDB.

I'm not personally swayed by the arguments put forth in the article, but it seems clear that (for the time being) Mozilla has decided that Web SQL Database is dead.

Further interesting comments about this article may be found on Hacker News.

〃温暖了心ぐ 2024-10-19 23:45:13

我的理解是,这现在称为“IndexedDB”
http://www.w3.org/TR/IndexedDB/

显然 Firefox 团队已经开始了实现这个:
http://hacks.mozilla.org/2011/01/indexeddb-在-firefox-4/

My understanding is that this is now called "IndexedDB"
http://www.w3.org/TR/IndexedDB/

Apparently the Firefox team has started implementing this:
http://hacks.mozilla.org/2011/01/indexeddb-in-firefox-4/

别闹i 2024-10-19 23:45:13

不知道有没有人知道答案。 Mozilla 不喜欢对 SQLite 的依赖,并决定走不同的路。然而,所有基于 WebKit 的浏览器都已经实现了它,而且我没有看到他们删除它,因为任何利用该规范而构建的网站都会被破坏。

这意味着至少在某些情况下,主要是在大多数浏览器都有 webkit 实现的移动领域,使用 HTML5 Web SQL 规范仍然有意义。我认为对于希望使用诸如phonegap 之类的框架创建移动应用程序的开发人员来说尤其如此。

有时,作为应用程序开发人员,您希望为用户提供对数据的访问权限,即使他们没有连接到互联网,或者连接速度很慢,并且某些类型的数据存储在数据库中比存储在数据库中更有效。 cookie 或 JSON cashe。例如,如果您的数据具有关系,那么执行联接查询来提取所需的数据比搜索 json 映射要容易得多、快捷得多。

我不认为该规范已经消亡,而且我实际上希望 Mozilla 能够改变他们的立场,以便开发人员可以使用它来解决移动 webkit 世界之外的问题。

I don't know if anyone knows the answer. Mozilla doesn't like the dependence upon SQLite and has decided to go a different way. However, all WebKit based browsers already have it implemented and I don't see them removing it as any websites built to take advantage of the spec would be broken.

This means that at least in certain contexts, mostly within the mobile sphere where most browsers have a webkit implementation, it can still makes sense to use the HTML5 Web SQL spec. I see this as especially true for developers who are looking to create mobile applications using a framework like phonegap.

There are some times where as an application developer you want to provide users with access to data even if they aren't connected to the internet or if the connection is slow and some types of data is just more efficiently stored in a database than in a cookie or JSON cashe. For example, if you have data that has relationships it is much easier and quicker to do a join query to pull the data you need than it is to search a json map.

I don't think the spec is dead, and I actually hope that Mozilla will reverse their stance so that developers can use it to solve problems outside of the mobile webkit world.

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