
An Introduction to Conflict-Free Replicated Data Types - signa11
https://lars.hupel.info/topics/crdt/01-intro.html
======
infogulch
Xi editor, featured here before [1][2], used CRDTs as a core part of the
initial design. In a retrospective [3] the author found -- paraphrasing --
that the kinds of answers given by CRDTs don't map well onto the problems of
making a text editor.

That makes me wonder, if not text editing (fair enough) what are CRDTs _good_
at representing? It seems this free online web course (?!) is trying to teach
the abstractions, maybe that would shed some light.

More generally, the key problem seems to be something like you need to
preserve the lower level behavior (merging rules) in the semantics of the
abstraction (CRDT behavior). That process seems to be an unsolved problem,
though I wouldn't be surprised if it's related to other unsolved/unsolvable
problems like the halting problem. Any interesting reads?

[1]:
[https://hn.algolia.com/?query=xi%20editor](https://hn.algolia.com/?query=xi%20editor)

[2]:
[https://news.ycombinator.com/item?id=23663878](https://news.ycombinator.com/item?id=23663878)

[3]: [https://github.com/xi-editor/xi-
editor/issues/1187#issuecomm...](https://github.com/xi-editor/xi-
editor/issues/1187#issuecomment-491473599)

~~~
macawfish
After studying [3], I came to the conclusion that the specific CRDTs they
attempted to use for Xi editor might be too low level to be useful in building
a text editor directly, but that this is not an intrinsic shortcoming of
CRDTs. Rather, the kind of automerging behavior of the CRDTs they used didn't
match the design needs of the editor.

(btw, check out chronofold, designed for text:
[https://arxiv.org/abs/2002.09511v4](https://arxiv.org/abs/2002.09511v4) )

Anyhow, I've come to see CRDTs as very low level primitives that can assist in
creating decentralized applications. Their strength is not that they
automagically solve the inherently subjective problem of merging
asynchronously edited, divergent data. That problem is more of a design
problem that needs to be solved on a case by case basis. The strength of CRDTs
is in that they have extremely well defined behavior and aren't fundamentally
reliant on a central coordinator or leader. Of course you can design in a
leader if you want, or multiple leaders. But that has nothing to do with
CRDTs. So I imagine them being more useful in composing higher level data
structures and smooth interfaces for users to make inherently difficult
decisions about merge conflicts themselves.

My favorite kind of CRDTs are "delta state CRDTs". They're very cool. I wish
the paper about them was easier to understand.

~~~
raphlinus
That's actually a reasonable position. We solved some problems, and had ideas
for others (for example, overloading "priority" to position the cursor after
things like inserting whitespace for indentation), but had a list of other
things we wanted to do, including "soft spans" (issue #244 in the repo) that
we never quite figured out how to do.

Ultimately, I'm not very smart, and someone who is could probably figure out
how to map all these other code editing problems to CRDT data structures. Once
that's done, the result should be compelling, because CRDT lets you take
advantage of low-latency local connections rather than requiring everything to
get serialized on a central server. It's research I would love to see being
carried forward.

------
AnthonBerg
In this context, I’ve enjoyed a series of papers on CRTDs and Operational
Transformation. The differences and similarities. The similarities might be
greater than most are aware, and the differences more specific. This is the
latest paper:
[https://arxiv.org/pdf/1905.01518.pdf](https://arxiv.org/pdf/1905.01518.pdf)

 _Real Differences between OT and CRDT under a General Transformation
Framework for Consistency Maintenance in Co-Editors_ – Proceedings of the ACM
on Human-Computer Interaction 2020 – Chengzheng Sun, David Sun, Agustina Ng,
Weiwei Cai, Bryden Cho

It’s an evolutionary series, here’s the rest I believe:
[https://arxiv.org/search/cs?query=Sun%2C+Chengzheng&searchty...](https://arxiv.org/search/cs?query=Sun%2C+Chengzheng&searchtype=author&abstracts=show&order=-announced_date_first&size=50)

