HTML5 客户端存储:WebSqlDatabase 与 WebStorage 与索引数据库

发布于 2024-11-26 10:26:09 字数 353 浏览 3 评论 0原文

我对 HTML5 中客户端存储的能力有一些疑问。到目前为止,我发现存在三种不同的可能性:

  • WebSQLDatabase:支持客户端 SQL 表,存储在 SQLite 数据库中。本标准已废止。这是否意味着当前支持此功能的浏览器将来会放弃此支持?

  • WebStorage 和 IndexedDB 对我来说非常相似。它们都提供键/值存储功能。差别在哪里呢?

I have some questions concerning the abilities of client storage in HTML5. From what I've found so far there are three different possibilities:

  • WebSQLDatabase: Supports client site SQL-Tables, which are stored in a SQLite Database. This standard is discontinued. Does this mean that browsers that currently support this will drop this support in the future?

  • WebStorage and IndexedDB seems quite similar to me. They both offer key/value-store capabilities. Where is the difference?

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

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

发布评论

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

评论(1

久隐师 2024-12-03 10:26:09

WebSQLDatabase:这是否意味着当前支持此功能的浏览器将来会放弃此支持?

答:查看这篇帖子,似乎 Safari 搁置了这项工作,因为他们已经停止评论和回复。另请参阅这个,Chrome 肯定会将当前 api 置于弃用状态。在未来的版本中,一旦 IndexedDB API 完全实现,他们可能会放弃支持。

WebStorage 和 IndexedDB.. 区别在哪里?

答: WebStorage 有一些存储机制,如 sessionStorage、localStorage 等。每个存储机制都有像存储一样的键/值对。 localStorage是HTML5功能,使用SQLite数据库,但有一个表和两个字段(键和值)。
而使用 IndexedDB,您可以创建带有大量表的数据库。WebSQLDatabase

由于主要的安全问题已被删除。例如跨域攻击。 参见

WebSQLDatabase: Does this mean that browsers that currently support this will drop this support in the future?

Ans: After looking at this post, it seems like safari put this work on hold, as they have stopped comments and ping backs. Also refer to this and this, Chrome will surely put current api in deprecated status. In future versions, once IndexedDB API completely implemented, they may drop the support.

WebStorage and IndexedDB.. Where is the difference?

Ans: WebStorage has some storage mechanisms like sessionStorage, localStorage etc. each has key/value pair like storage. localStorage is of HTML5 feature which uses SQLite database, but with one table and two fields (key and value).
Whereas using IndexedDB you can create the number of databases with number of tables..

WebSQLDatabase has been dropped because of the main security issue. e.g. cross-origin attack. see

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