News for hackers. Stuff that matters.
Re:Resilient Sync for Local First by bombela on Tuesday June 25, 2024 @05:13AM (#40786218)
Alright, try this in Google Doc.

Two users simultaneously select the same word, and replace it by a different word each.

You might end up with: "apple" -> "carrot orange"

Sure it technically merged, and did not lose data. But you still need humans to reconcile the final state anyways. Worse, you might not even notice that you need to cleanup.

Re:Resilient Sync for Local First by vlovich123 on Tuesday June 25, 2024 @09:24AM (#40788319)
Bad example. Google docs doesn’t use CRDTs but uses OT instead. CRDTs may handle your scenario just fine depending on how they decide to handle this scenario.

The easier scenario that is independent of the specific algorithm is the one I described (have follow up comments describing it in more explicit detail) where you have a logical meta instruction within the document and then the document is updated based on outdated meta instructions offline but when they come back online the meta instructions were changed.

Then there’s not even a merge conflict to really worry about.

Re:Resilient Sync for Local First by mattarm on Tuesday June 25, 2024 @11:32AM (#40789879)
> Bad example. Google docs doesn’t use CRDTs but uses OT instead. CRDTs may handle your scenario just fine depending on how they decide to handle this scenario.

The CRDT may pick one or the other replacement word, but who is to say that either choice is correct? Perhaps including both words is correct.

> Then there’s not even a merge conflict...

Agree, this is what CRDTs are all about.

> ...to really worry about.

I think it is important to make clear that CRDTs do not "solve" the merging problem, they merely make it possible to solve in a deterministic way across replicas.

Often, CRDTs do not capture higher level schema invariants, and so a "conflict free" CRDT merge can produce an invalid state for a particular application.

There is also the example above, where at the application level, one particular merge outcome may be preferred over another.

So, it isn't as simple as having nothing to worry about. When using CRDTs, often, there are some pretty subtle things that must be worried about. :-)

Re:Resilient Sync for Local First by vlovich123 on Tuesday June 25, 2024 @02:25PM (#40791807)
Yup 100% agreed.
Re:Resilient Sync for Local First by kiitos on Thursday June 27, 2024 @02:10AM (#40807777)
> The CRDT may pick one or the other replacement word, but who is to say that either choice is correct?

You, as the application developer.

> I think it is important to make clear that CRDTs do not "solve" the merging problem

They literally do, in the context in which they are defined. Which is about data consistency, not semantic correctness.

> Often, CRDTs do not capture higher level schema invariants,

CRDTs never capture higher level schema invariants. Just like TCP doesn't enforce HTTP session authentication. Orthogonal concerns.