HTML5 SQLite vs. Base Database in PhoneGap Case

I am creating a PhoneGap application for Android and iOS.

I want to know which one is better to choose for database management: HTML5 SQLite or the device’s native database.

In case of natural use, I need to build a plugin for interaction.

Please suggest me the best option depending on performance and speed.

+6
source share
3 answers

I tested with POC that the Native DB Android / iOS is much faster than WebSQL (HTML5), in the case of the PhoneGap application we must use the plugin for the Native database. in my test; I ran request 999 in a PhoneGap application with a plugin for the native environment, and the results are:

558% faster in Android computer requests, 275% faster in htc droid hd and surprisingly 2327% faster for htc wildfire.

in iOS, the results are just fun requests - it's 2k + percent faster in Simulator / iPhone 4 and 5600% faster in iPhone 3GS.

+9
source

The Web SQL database standard is no longer being developed. It will probably be replaced by IndexedDB. I would not rely on its existence if I were you.

From specification :

Caution. This specification is no longer under active maintenance, and the Web Application Working Group does not intend to support it further.

+2
source

I don’t know about my own database, but HTML5 WebSQL is very slow on iPhone when using tables with hundreds of rows, mostly 3G, 4G is a little better. On Android, there are no problems launching quite pleasant queries - we thought that it would be the same on the iPhone, but we had to abandon the use of WebSQL in our project and rewrite everything to JSON and many other functions that had the functionality of several simple WebSQL queries.

It's a shame that WebSQL support has been officially canceled, but is currently supported on both Android and iPhone, and this is very convenient for some cases. Therefore, I hope, and I think, that WebSQL will be supported "not officially", but still in Android and iPhone in the future.

As for your question - my experience tells me that it depends on the structure of your tables, on complex queries and, mainly, on the number of rows in the tables. If you have dozens of rows, this is fine for using WebSQL, but if you click 100 or more rows in a table, the iPhone will be slow.

0
source

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


All Articles