Advising Simperium (YC S10)
al3x.net
al3x.net
Is it just one of those "hard problems" that's still searching for a solution, or is there a tried and true online/offline sync algorithm that works?
Rule-based resolution,
Locking,
Merge
Rule based is something like last person wins, always accept this actor's changes, or pick the variation based on some simple criteria. This is easy to implement but it causes loss of (potentially unrelated) changes that one person made.
Locking (pessimistic and optimistic) tries to make the above better because it either prevents divergence or prevents changes from being lost by returning an error (refusing to commit the conflict-inducing change to one of the data stores.)
Merge is the hardest of all, and it is a series of trade-offs and compromises. From diff-match-patch to three way merge to operational transformation, vector clocks and so on, there are many ways to try and handle merging that all have their own ups and downs. (google the iterating bigrams in that sentence for more info.). You ultimately need to get your own application logic in the merge process -- for instance, "we want to disallow changes to the title After the PDF has been sent" is a business rule, but then your remote client had changed the title while disconnected and somebody else sent the PDF. There is no simple algo that will handle text merging, state machine guards, and varying merge strategies. Finally, different merge strategies have different amounts of data transfer required to perform the synch negotiation.
Thank you, Google, for screwing that one up.