HTML5 IndexedDB,Web SQL数据库和浏览器大战 [英] HTML5 IndexedDB, Web SQL Database and browser wars

查看:114
本文介绍了HTML5 IndexedDB,Web SQL数据库和浏览器大战的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始开发具有脱机数据库存储要求的Web应用程序。长话短说,应用程序应该可以运行:




  • 其中一个主要的桌面浏览器,Chrome首选

  • Safari上的iOS

  • Android的原生浏览器(基于V8和WebKit)
    $ b 因此,问题是选择哪种技术:IndexedDB或Web SQL数据库?

    关于Web SQL数据库,一方面它已准备好用于任何上述情况。另一方面,Mozilla声称Firefox永远不会实现它,并且根据HTML5 工作草案规范已经到了一个绝境:


    这个规范已经陷入了僵局:所有感兴趣的实现者都使用了相同的SQL后端(Sqlite),但我们需要多个独立的实现来沿着标准化路径前进。在另一个实现者对实现这个规范感兴趣之前,SQL方言的描述只是对Sqlite的引用,这对于标准来说是不可接受的。如果你是一个对实现独立SQL后端感兴趣的实现者,请联系编辑,以便他可以编写一个方言规范,从而允许此规范向前发展。


    IndexedDB是Mozilla提倡的另一种选择,但它只会在Firefox 4中出现.Microsoft感兴趣,Chrome也会支持它。我对Apple关于IndexedDB的计划一无所知。

    我个人倾向于选择Web SQL数据库,但仅仅因为我习惯了SQLite,我喜欢这种力量, SQL的表现力,我理解关系模型。对我而言,IndexedDB是一个不确定因素。

    这就是说,我害怕投注错误的马匹。即使IndexedDB成为标准,对于Web SQL数据库的支持是否会继续存在是否安全?

    (关于CouchDB的注意事项:您是否也将其视为另一方面呢?)

    解决方案

    考虑到只有WebSQL支持您列出的所有三项要求,您的选择不应该简单吗?您对Safari或Android的开发路线图没有深入了解,因此请使用您的可用产品。


    I'm starting the development of a web app with offline database storage requirements. Long story short, the app should be able to run on:

    • One of the major desktop browsers, Chrome preferred
    • Safari on iOS
    • Android's native browser (based on V8 and WebKit)

    So the question is which technology to choose: IndexedDB or Web SQL Database?

    Regarding Web SQL Database, on one hand, it is ready to be used in any of the above scenarios. On the other, Mozilla has stated Firefox will never implement it, and acording to the HTML5 working draft the specification has reached an impasse:

    This specification has 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. Until another implementor is interested in implementing this spec, the description of the SQL dialect has been left as simply a reference to Sqlite, which isn't acceptable for a standard. Should you be an implementor interested in implementing an independent SQL backend, please contact the editor so that he can write a specification for the dialect, thus allowing this specification to move forward.

    IndexedDB is the alternative advocated by Mozilla, but it will only come in Firefox 4. Microsoft is interested and Chrome will support it as well. I know nothing of Apple's plans regarding IndexedDB.

    I'm personally inclined to choose Web SQL Database, but just because I'm used to SQLite, I like the power and expressiveness of SQL, and I understand the relational model. IndexedDB, for me, is an uncertainty.

    That said, I'm afraid of betting on the wrong horse. Is it safe to assume support for Web SQL Database will continue to exist, even if IndexedDB becomes the standard?

    (A note on CouchDB: do you also see it as an alternative?)

    解决方案

    Considering only WebSQL supports all three requirements you have listed, shouldn't your choice be simple? You have no insight into the development roadmap for Safari or Android, so use what you have available.

    这篇关于HTML5 IndexedDB,Web SQL数据库和浏览器大战的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆