2 ms·
Easiest way I found is to use an "append-only" mentality to avoid conflict entirely. So, to take the vote example, using: [ {ts: <upvoted_time>, author:
by d0m 11y ago
Easiest way I found is to use an "append-only" mentality to avoid conflict entirely. So, to take the vote example, using:
[
{ts: <upvoted_time>, author: <id_of_author>. action: 'up'},
{ts: <upvoted_time>, author: <id_of_author>, action: 'down'},
{ts: <upvoted_time>, author: <id_of_author>, action: 'up'}
]
You can sync from the server the changes after a certain timestamp, and the client can calculate the accurate value.
- espadrine 11y agoThat common approach is both elegant and tricky. It requires very precise clocks and time synchronization, as some non-commutative operations are order-dependent (such as list insertion). That is why Google's TrueTime API (introduced in Spanner[0]) is such a big deal. [0]: http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/archive/spanner-osdi2012.pdf http://static.googleusercontent.com/external_content/untrust...