We decided that potential overlaps are an acceptable solution.
over 9 years ago
Yeah, any improvements over millisecond-level overlaps are a) increasing the granularity to microseconds, etc and b) having the server maintain a state of what it sent to each client, which is an overkill.
I have a question about timing and synchronization of data. Could you help me with best practices for ensuring a device always receives any changes to a collection.
Here’s a situation I’ve trying to avoid:
00:01 Hello World data added to a collection and given a timestamp of 00:01 server time
00:01 Client asks for everything > 00:00. We give Hello World and tell the client the lastSync time was 00:01
00:01 CRITICAL DATA CREATED
00:05 Client asks for everything from > 00:01 (e.g 00:02 - 00:05) and nothing is sent back.
I realize that server times are millisecond level but assume even at that level it’s possible to respond to a request for data and have something new added to the collection in the same millisecond.
I could have my requests overlap (>=) and potentially send duplicate data but that somehow feels wrong.
Another, potentially odd solution, is that when the client asks for everything new, we actually ask for everything up to a second (or so) ago to ensure that new additions have settled.
Is there a better system than this?
I appreciate any help.