Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 SQLite vs Native Database in case of PhoneGap

I am building a PhoneGap application for Android and iOS.

I want to know which one is a better selection for database management: HTML5's SQLite or Native database of device.

In case of native use, i need to build a plugin for interaction.

Please suggest me a better option according to performance and speed.

like image 893
GauravSTomar Avatar asked Aug 05 '11 12:08

GauravSTomar


2 Answers

i have tested with a POC that Native DB of Android/iOS is too much faster then WebSQL (of HTML5), in case of a PhoneGap App we should use a plugin for Native database. in my test; i have run 999 insert query in a PhoneGap App with Plugin for native environment and the results are:

in Android queries are 558% faster in Emulator, 275% faster in htc droid hd and amazingly 2327% faster for htc wildfire.

in iOS the results are just hilarious queries are 2k+ percentage faster in Simulator/iPhone 4 and 5600% faster in iPhone 3GS.

like image 143
GauravSTomar Avatar answered Nov 17 '22 17:11

GauravSTomar


The Web SQL Database standard is no longer being developed. It will probably be replaced by IndexedDB. I wouldn't rely on its existence if I were you.

From the spec:

Beware. This specification is no longer in active maintenance and the Web Applications Working Group does not intend to maintain it further.

like image 36
Matt Avatar answered Nov 17 '22 17:11

Matt