IndexedDB and IndexedDB v / s performance metrics WebSQL performance comparison

WebSQL and IndexedDB are both database APIs for accessing (CRUD) the underlying embedded database in a web browser. What if I'm right, it looks like SQL for Access (CRUD) to any client-server database such as Oracle, etc. (In many cases, support for both WebSQL and IndexedDB is available in a single browser)

  • So, does this mean that both WebSQL and IndexedDB access (CRUD) the same underlying embedded database, and if so, it will have the same performance for all web browsers!
  • But I think this is not the case, does this mean that the web browser will have more than one built-in database? And why should there be 2 built-in databases in one browser?

And since WebSQL and IndexedDB are APIs, this means that it’s not entirely correct to talk about the performance of WebSQL and IndexedDB (since they are more like a query / access language), but it depends on the performance of the embedded database. And according to Google, LevelDB is faster than SQLite

  • Is it right to say that it is not the performance difference between WebSQL and IndexedDB that is essential, but the performance of the embedded database?
  • What is the base embedded database for IE, Chrome, Android? I could not find this information on the Internet, did anyone find or compile it?
+6
source share
1 answer

To solve its 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 Chrome and Safari leave, both are born from WebKit (although, since v28 Chrome runs on fork from WebKit, it is called "Blink"). In the past, both of these browsers used SQLite as the base database for both WebSQL and IndexedDb, but Chromeed IndexedDb switched from SQLite to LevelDB.

To answer the second question, Chrome uses two different underlying database technologies:

WebSQL -> SQLite

IndexedDb β†’ LevelDB

I suspect they support WebSQL as SQLite, as they know this works. WebSQL is now deprecated, and at some point it will be deleted, so why would they waste time porting it to LevelDB.

In terms of performance between WebSQL / IndexedDb and the performance of the base database, from experience with iOS Safari, both IndexedDb and WebSQL use the SQLite database, but they differ significantly from how the underlying database is built and how they work. In my testing, I found that WebSQL was twice as fast as 1000 simple database inserts compared to IndexedDb on Safari in iOS8.

In terms of your last question, I found this:

For IE:

WebSQL β†’ Not Supported

IndexedDB β†’ Extensible Storage

For Firefox:

WebSQL β†’ Not Supported

IndexedDB -> SQLite

For Safari:

WebSQL -> SQLite

IndexedDB -> SQLite

For Chrome:

WebSQL -> SQLite

IndexedDB β†’ LevelDB

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

+16
source

Source: https://habr.com/ru/post/984155/


All Articles