I am creating two mobile apps, on iPhone and on Android.
As I’m updating data on the server, the mobile apps frequently update their databases and so the sync is kept between the remote and local databases.
But what happens if a user say delete a comment ? The row in my local database (mobile) is just not going to get updated anymore.
I was thinking of maybe adding a delete boolean column to all my entities so that I could just update the row with deleted:true instead of actually deleting it, but user wise I could see how that would be a problem.
What is the best way to fix this problem ?
Thanks !
EDIT : A bit more information on how it works now :
My webservice acts as a JSON API.
So when I say /items.json it gives me an array of the top 20 items of all time sorted by popularity, I can then paginate (/items.json?page=2) to get more data, or add a category (/items.json?page3&cat=bla)
So the way it is setup now I basically call the /items.json if my local DB is empty, or if it has been a long time since you opened the app. And I make (for the Android app for now) an : INSERT OR REPLACE INTO, so that the rows are either added or updated with the right information.
How exactly do you keep the tables in sync? Is there no way to also transmit the information that row X has been deleted and should also be deleted in the mobile apps?