Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Sqlite Storage Limit

Tags:

android

sqlite

I am developing an android application, which takes user location in every 30 seconds and storing in the application's own sqlite db. In my calculation I need to store around 1 Lac records. I have only 1 table with following details, ID(Integer), latitude(real), longitude(real), date(text), time(text).

Is it safe to store the details in sqlite?

Will it cause any problem in regards to performance.

Please help me.

like image 717
Sino Avatar asked Sep 28 '26 07:09

Sino


1 Answers

SQLite's limits are usually not of interest on mobile devices. The device is by far more constrained.

For example if you add 1kB of data each 30 seconds you'll generate around 60GB of data per year. That's not going to fit on any device but would be no problem for SQLite.

Performance can be a problem if your queries are slow. Indexed queries run in some variation of log(N) time which means that working with billions of row of data has roughly the same performance as a few thousand. If your queries are complex you can easily get into N^2 complexity or worse meaning that performance will be terrible once you reach like a thousand rows. A bit more here: http://www.sqlite.org/queryplanner.html

I would recommend to keep that size limit in mind and add a way to recycle data if there is not enough space. The internal storage (not enough space to install new apps?) is typically very limited.

like image 152
zapl Avatar answered Sep 30 '26 21:09

zapl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!