简体   繁体   中英

What is best way to store large data in local for iOS/Android

I'm working on an app and I have tried to use local storage but I'm not sure if it will be OK for my project. I need to store really large data every second in my local database, and at the end of the day send to my server. This can be large data because every second write my GPS coordinates.

What is best: SQLite, local storage or websql?

I work using cordova.

I appreciate for your help.

Regards

I am an Android developer so this is how it works in Android :

Shared Preferences - simple key/value pairs specific to your application. This is probably the closest to WebStorage - only for small amount of data.

Internal Storage - read/write files(only the app can access it)

External Storage - SD card file storage(app + other apps including the user) can access it).

Databases ( SQLite ) - better for large amounts of structured data

Network - obviously, you can store/retrieve data remotely if needed (like Firebase).

What would I choose? if data is structured then I would choose SQLite.

More detailed information : https://developer.android.com/training/data-storage

cordova-sqlite-storage is Native SQLite component with API based. It will easily handle large data and easy for CRUD operation.

Yes you can use cordova-sqlite-storage for large data inputs. But I think it is also advisable not to stress your device with so much data in it because mobile is just mobile with so many limitations in terms of hardware. Maybe you can just set a treshold of data size and after reaching it, send it to your server then clear your database.

The point is don't stress you device, use minimum data as much as possible to provide a clean app for the users.

I am an iOS Developer, the best way to store big data listed below. 1. Sqlite 2. CoreData 3. Realm

Any database (local) you can use which suits your application. You can use the database according to your needs.

There are other storage options too. We have UserDefaults but, that's not good for storing big data. That's good for storing small data like boolean or strings or integers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM