I have a webservice which manages some data using SQLite. I managed to do it based on examples and it works perfectly, but as I am not an expert I have some doubts about efficiency, specially if the database grows.
In this DB there are basically 2 tables, one for users with some configuration data, and another one for contacts belonging to each user.
Regularly, or under request, each user app uploads his contacts to the server. From one upload to the next, this data will be exactly the same, or will be nearly the same with some minor modifications.
My question is, what would be more efficient (in SQLite)?
a) Erase the previous data in the table belonging to that user and write it again with the fresh info
b) Read user's contacts in the table, compare them with the new ones and update them, i.e.: do nothing with the registers that do not change, delete the ones that are missing and insert the ones that were not in the previous one?
c) other options
Thanks in advance
In this DB there are basically 2 tables, one for users with some configuration data, and another one for contacts belonging to each user.
Regularly, or under request, each user app uploads his contacts to the server. From one upload to the next, this data will be exactly the same, or will be nearly the same with some minor modifications.
My question is, what would be more efficient (in SQLite)?
a) Erase the previous data in the table belonging to that user and write it again with the fresh info
b) Read user's contacts in the table, compare them with the new ones and update them, i.e.: do nothing with the registers that do not change, delete the ones that are missing and insert the ones that were not in the previous one?
c) other options
Thanks in advance