1. with HLC, what if one device is way off, like 1 year in the future? Does that mean all devices sync to use that furthest-future time and then just start using the counter only? How do they determine who will win if they have the same timestamp and counter? You might need a client ID to sort them by, or another timestamp algorithm.
2. your example with modifying balance shows how weak LWW is. If 2 clients change a balance by +20 and -20, you would *want* the result to be a net zero change. The most naive approach is to let the server decide the value by who arrived last. Your approach by adding a timestamp is slightly better. For a balance, you'd want a PN-Counter that captures increments and decrements so they can merge together.
I'd be interested how you can store different types of CRDTs in SQLite.
Sep 24
at
5:28 PM
Log in or sign up
Join the most interesting and insightful discussions.