Offline synchronization of mobile devices with the web service


Im am developing a webservice for an App that I am writing. I want to make the App offline accessible.

I made that webservice so that if you request JSON from the webservice you can give a date: /color/colors/date/2014-03-01T12:00/

If you don't give the date you will get everything that is inside the database and that is active. If you give the date you will only get everything that is updated after that date.

Now my problem is that if I remove something from the webservice of from the App then it will not be synced and the other devices will never know that it is removed.

I could work with a field where I say that a record is removed but then I need to keep every record and I can't delete any record.

Is there a better way to do the syncing? Or what is the best way?

I think there is no possible way to detect the deleted entry's change, unless you send the information that the entry is deleted. The best practise you set a field in the table with integer type, then you can set this value on updates. You don't have to set it only 1 or 0, you can use bigger numbers (for example I used 30 on that entries, that I deleted on 20th march , on this day was a big code logic change. after that i knew when the status integer is 30, then i deleted this row after that date.) It may be a silly example, but you can implement your own logic.