tdex-network / tdex-app

📱 Mobile app for making trades on TDEX
11 stars 10 forks source link

Investigate if changing storage method is necessary #552

Open Janaka-Steph opened 2 years ago

Janaka-Steph commented 2 years ago

We are currently using Capacitor v3 @capacitor/storage (https://capacitorjs.com/docs/v3/apis/storage). On Capacitor v4 it changed for this plugin https://capacitorjs.com/docs/apis/preferences. But there are basically the same, using UserDefaults on iOS and SharedPreferences on Android.

Even though there is no size limit on iOS UserDefaults, the doc says: "This API is not meant to be used as a local database. If your app stores a lot of data, has high read/write load, or requires complex querying, we recommend taking a look at a SQLite-based solution."

We may gain some perf using https://github.com/capacitor-community/sqlite

tiero commented 2 years ago

What if we use use Ionic Storage with SQlite as "storage"? This way we retain the Key/Value interface we already use

https://github.com/ionic-team/ionic-storage#sqlite-installation

Janaka-Steph commented 2 years ago

Yes it is an option too. Would be this plugin https://github.com/storesafe/cordova-sqlite-storage Last commit July 2021. We can give it a try. But it is not compatible with Capacitor 4, may never be, and may be an issue later.