11

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

4

5 回答 5

8

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

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

于 2011-01-24T21:36:12.430 回答
2

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

于 2011-04-15T03:12:51.513 回答
1

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.

于 2010-06-09T11:36:10.127 回答
1

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

于 2011-04-27T15:57:07.330 回答
0

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

于 2010-06-08T22:08:51.163 回答