Of course, I don't ask to you post me code of client and server. I just never make it early. I want understand logic of this process.
Now, I have an Android app that has different data in the database of different users. (Data can be different on each device of user). And I need to write a server and update my app-client to support the data synchronization.
What problem I have at now? I cannot understand how to remove items from database if client cannot connect to server at this moment (to I can remove data on server I need to save all removed items until app-client hasn't connection to a server)
How to correct synchronize time and etc.
How to store transaction log on client? For example, user modifies a some item but client hasn't connection. How can server understand that this I item was modified?
I will very glad any help by my theme and any links and docs.
P.S. Sorry for my English. I'm really noobie in this and due to my bad English cannot find details docs.
P.S.S. If you need more details, please, write me I'll add.
My current model. I took a simple table for example.
Client has local table with fields:
Server table has:
- ID - server ID
- Rev - revision of the row in the server database
database and flag 'm' then update row in the server database and
increment revision in both databases. (So if some devices has all
same revision and flag only first connected device write changes in
the server database; all another clients just gets this update from
the server and loses their).
it will remove everywhere.
I don't write all cases I think it's understandable. What's bad in my model. How can I improve it? I cannot use timestamp because clock on different devices can have a different time.