4 ms·
It goes on: > Although only one of the concurrently written values shows up in the object, the other values are not lost. They are merely relegated to a confli
by twic 5y ago
It goes on:
> Although only one of the concurrently written values shows up in the object, the other values are not lost. They are merely relegated to a conflicts object.
If you have a procedure for resolving conflicts on scalars (for example, a field is a maximum, and you can take the maximum of the conflicting values), you can detect the conflicts and resolve them manually.
On a brief inspection, it appears that the conflict objects hold the conflicting values, but not the previous value, so there's no way to do a three-way merge here. That makes it impossible to resolve conflicts on a field which is a counter, for example.
- samwillis 5y agoAlthough it's not implimented you could create a Counter CRDT using an array of numbers, appending each addition or negation, the 'value' being the sum of the array. This can be compressed by each client changing its most recent value if a sync has not been sent. There is probably also other optimisations you can do too, probably around keeping track of which client made which change and updating its value.