I just came across the following paragraph in the AppEngine documentation for Query Cursors:
An interesting application of cursors is to monitor entities for unseen changes. If the app sets a timestamp property with the current date and time every time an entity changes, the app can use a query sorted by the timestamp property, ascending, with a Datastore cursor to check when entities are moved to the end of the result list. If an entity's timestamp is updated, the query with the cursor returns the updated entity. If no entities were updated since the last time the query was performed, no results are returned, and the cursor does not move.
For this to work reliably, there would have to be some sort of guarantees about the clock synchronization across different server instances. Otherwise you could get the following scenario:
As far as I understood, there never were any such clock synchronization guarantees. Did this change???
Update:
I just realized that even if the clocks were sync'ed perfectly, this approach might miss results due to the eventual consistency of queries. If a later update ends up getting committed before an earlier update and makes it into a simultaneous query while the earlier one doesn't, it will hide the earlier update. Or am I missing something?
The only docs that i found on clock and Google Cloud Platform, are here and here. According to the first link post, instances are synced using NTP service, and it's done for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With