New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PouchDB in Cordova #5514
Comments
I think actually the fastest storage adapters right now are web storage such as websql, indexeddb but only because having to bridge to native code is costly so the only real benefit of using the sqlite adapter for example is to be able to store lots of data without being effected by any web storage limits you'd find in browsers.. |
But having PouchDB in Electron running in LevelDB (which I couldn't make it work), I'd assume it's a change of performance. I saw that @nolanlawson published something about PouchDB in Java, so there must be a benefit of using native code. |
@NickColley is correct. The basic explanation as to why "native" is not faster for Cordova is that Cordova can only allow communication between the native layer and the WebView via string-passing. Therefore any binary data has to be serialized as strings and sent between the two, which adds a huge cost. E.g. for large attachments, PouchDB+CordovaSQLite can actually crash the device because it's using too much memory. Electron on the other hand has implemented a very efficient binary protocol between the Node.js layer and the web layer. This is why it's typically better to use LevelDB/SQLite in Electron rather than IndexedDB/WebSQL. In Cordova, however, the most efficient option is typically IndexedDB/WebSQL. Also no, there are no plans for a PouchDB Cordova plugin, although there are both cordova-sqlite-storage and SQLite Plugin 2 which PouchDB can use via |
It helped! Fully understood. If you want to check it out: @nolanlawson : nwjs/nw.js#94 (comment) That can change things in the future.. Running Node in Cordova (: |
Hello folks, I was wondering..
Is there a native cordova plugin in the schedule of PouchDB?
https://cordova.apache.org/plugins/
I know it works whit indexeddb, websql, sqlite, but it would be great if there was a PouchDB plugin which can communicate natively with the device. Would it be more faster? More efficient?
The text was updated successfully, but these errors were encountered: