IndexedDB的性能和IndexedDB的V / S的WebSQL性能对比 [英] IndexedDB Performance and IndexedDB v/s WebSQL performance comparison

查看:616
本文介绍了IndexedDB的性能和IndexedDB的V / S的WebSQL性能对比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的WebSQL和索引资料是用于访问(CRUD)在Web浏览器的底层嵌入式数据库既DB API。其中,如果我是正确的,是像SQL访问(CRUD)的任何客户端 - 服务器的数据库,如Oracle等。(在这两个的WebSQL和IndexedDB的许多支持的情况下可以用相同的浏览器)


  1. 那么,这是否意味着双方的WebSQL和索引资料所访问(CRUD)相同的底层嵌入式数据库,如果它的话,那么它将对所有Web浏览器相同的性能!


  2. 但我认为不是这样的,所以这是否意味着网络浏览器将有多个底层嵌入式数据库?以及为什么应该有2相同的浏览器嵌入式数据库底层?

和自的WebSQL和IndexedDB的是API的,所以这意味着它不完全正确的说的WebSQL和IndexedDB的性能(因为他们更喜欢的查询/访问语言),但它显著依赖于嵌入式数据库底层的性能。而且,每谷歌,性LevelDB比SQLite的



  1. 它正确地说,显著它不是的WebSQL和索引资料之间的性能差异,但基本的嵌入式数据库的表现呢?

  2. 什么是IE,Chrome浏览器,Android浏览器底层嵌入式数据库?我无法找到网页上的信息,有没有人发现或曾经编了吗?


解决方案

要解决第一个问题,的WebSQL从未在Internet Explorer或火狐(实施的 http://diveintohtml5.info/storage.html http://caniuse.com/#feat= SQL存储)。在留下Chrome和Safari,大浏览器方面都脱胎于的WebKit(虽然自V28的Chrome已经从WebKit的叉子上运行,被称为闪烁)。在过去的这两种浏览器使用SQLite作为两个的WebSQL和IndexedDB的底层数据库,而Chrome切换IndexedDB的SQLite的,从到性LevelDB。

要回答你的第二个问题,Chrome使用2个不同的底层数据库技术:

的WebSQL - > SQLite的

索引资料 - >性LevelDB

我怀疑他们保持的WebSQL的SQLite作为他们知道它的工作原理。的WebSQL现在去precated并在某些时候它会被如此撤职为什么他们会花时间在移植它性LevelDB。

在对战底层数据库的性能,从iOS上的Safari浏览器体验的WebSQL / IndexedDB的之间的性能方面,无论是IndexedDB和使用的WebSQL SQLite数据库,但他们在如何底层数据库构建,以及如何进行巨大差别。在我的测试,我发现的WebSQL的两倍,与IndexedDB的关于Safari在iOS8上做的比较简单的1000年的数据库插入一样快。

在你的最后一个问题而言,我发现了这一点:

对于IE:

的WebSQL - >不支持

IndexedDB的 - >扩展存储引擎

对于Firefox:

的WebSQL - >不支持

索引资料 - > SQLite的

对于Safari浏览器:

的WebSQL - > SQLite的

索引资料 - > SQLite的

对于浏览器:

的WebSQL - > SQLite的

索引资料 - >性LevelDB

(来源:WebKit的项目,<一个href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=837141\">https://bugzilla.mozilla.org/show_bug.cgi?id=837141, <一href=\"http://www.aaron-powell.com/posts/2012-10-05-indexeddb-storage.html\">http://www.aaron-powell.com/posts/2012-10-05-indexeddb-storage.html)

WebSQL and IndexedDB are both DB API for accessing (CRUD) the underlying embedded database in the web browser. Which, if I am correct, is like SQL for accessing (CRUD) any client-server database like Oracle etc. (in many case support for both WebSQL and IndexedDB is available on same browser)

  1. So, does it mean that both WebSQL and IndexedDB are accessing (CRUD) the same underlying embedded database and if that it the case then it will have same performance on all web browsers!
  2. But I think that is not the case, so does it mean that a web browser will have more than one underlying embedded database? And why there should be 2 underlying embedded database in same browser?

And since WebSQL and IndexedDB are API's, so it means that it not entirely correct to say performance of WebSQL and IndexedDB (because they are more like query/access language), but it significantly depends upon the performance of underlying embedded database. And, as per Google, LevelDB is faster than SQLite

  1. Is it correct to say that significantly it is not the performance difference between WebSQL and IndexedDB, but performance of underlying embedded database?
  2. What are the underlying embedded database for IE, Chrome, Android browser? I couldn't find this information on web, has anybody found or compiled it ever?

解决方案

To address your first question, WebSQL was never implemented in either Internet Explorer or Firefox (http://diveintohtml5.info/storage.html, http://caniuse.com/#feat=sql-storage). In terms of the "big browsers" that leaves Chrome and Safari, both born out of WebKit (although since v28 Chrome has been running on a fork from WebKit, called 'Blink'). In the past both these browsers used SQLite as the underlying database for both WebSQL and IndexedDb, but Chrome switched IndexedDb from SQLite to LevelDB.

To answer your second question, Chrome uses 2 different underlying database technologies:

WebSQL -> SQLite

IndexedDb -> LevelDB

I suspect they keep WebSQL as SQLite as they know it works. WebSQL is now deprecated and at some point it will be removed so why would they spend time porting it over to LevelDB.

In terms of performance between WebSQL / IndexedDb versus the performance of the underlying database, from experience on iOS Safari, both IndexedDb and WebSQL uses a SQLite database but they differ vastly in how the underlying database is constructed and how they perform. In my testing I found that WebSQL was twice as fast as doing 1000 simple database inserts compared with IndexedDb on Safari in iOS8.

In terms of your last question, I found this out:

For IE:

WebSQL -> Not supported

IndexedDB -> Extensible Storage Engine

For Firefox:

WebSQL -> Not supported

IndexedDB -> SQLite

For Safari:

WebSQL -> SQLite

IndexedDB -> SQLite

For Chrome:

WebSQL -> SQLite

IndexedDB -> LevelDB

(Sources: The WebKit project, https://bugzilla.mozilla.org/show_bug.cgi?id=837141, http://www.aaron-powell.com/posts/2012-10-05-indexeddb-storage.html)

这篇关于IndexedDB的性能和IndexedDB的V / S的WebSQL性能对比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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