From Ionic doc:
"When running in a native app context, Storage will prioritize using SQLite, as it’s one of the most stable and widely used file-based databases, and avoids some of the pitfalls of things like localstorage and IndexedDB, such as the OS deciding to clear out such data in low disk-space situations."
From PouchDB doc:
"We recommend avoiding Cordova SQLite unless you are hitting the 50MB storage limit in iOS, you require native or preloaded access to the database files, or there’s some other reason to go native. The built-in IndexedDB and WebSQL adapters are nearly always more performant and stable." https://pouchdb.com/adapters.html
It seems that there is a conflict of informations there.
Hey Yury, not sure if it is a conflict. Those statements are done on a very broad scope/scale and when it comes to a specific project - you can decide what works best for you.
Personally I tried both, both have some issues and pretty good support. In my case I chose localForage (Ionic Storage) simply cause its part of Ionic offering and working with it proved to be successful.
part of Ionic offering, which hopefully means good support
small size (8kb?)
Cons:
almost no control over db, not sure you can index data etc
syncing data with server needs custom code (we wrote it)
no bulk type operations (does have .forEach method though)
supports storage of blobs but not as attachments, both dbs have issues with binary data I think. We saw some behaviors and super hard to triage issues when we stored binaries locally. Once we removed those - issues were gone…
PouchDB
Pros:
nice syncing mechanism with other couchDB (although couchDB is considered to be slow, for lazy replication its good)
bulk operations, built-in conflict resolution
extensive API, you can do a lot of things, indexes etc
Cons:
more complex API to work with. For a put you almost always need to read document and use its revision to store it back etc
basically complexity led to more bugs in our case.
We actually had Mongo that we started with. And it worked ok. Problem is we have to have “transactions” and Mongo has a solution but not native one, so we switched to PostGres.
As for Mongo - it was OK and we ran in no problem with it. But yes since we had no sync feature we already decided to evaluate migrating to Ionic Storage. Now we live with the latter and its doing its job great (for now)
@FrancoisIonic Heey;) can you elaborate a bit more what do you mean by “it was deleted”?
as a project it exists right? do you mean it is not reliable as a browser based storage or?
Also eager to learn what exactly do you call Google Database:)
Emmm its like saying “internet” google cloud platform has 30+ offerings so I was interested to learn what was mentioned as equivalent to pouchDB/Storage
Well there’s only the SQL, Big Data and their NoSQL (forget what it’s called) database engines.
Why not use LokiJS with Storage? It works great in tandem, it’s what I did with my app and hadn’t had problems. I haven’t tried syncing with a server side database but I will be trying to do that when I move my app to the cloud server next week/month.
Chime in once you tried;) I am still puzzled with what Francious mentioned as “it was deleted”. Ionic Storage works perfectly for me. Yes it has no server side persistence, but I am free to use whatever I want.