Hacker News new | ask | show | jobs
by nathansobo 1300 days ago
We honestly don’t solve it yet, but haven’t found it that big of an issue in practice. Would be curious to see the best resource on it.
2 comments

I've described this issue in my blog post together with CRDT variants that address and solve it: https://bartoszsypytkowski.com/operation-based-crdts-arrays-...

In practice, many CRDT libraries nowadays (eg. Yjs and Automerge) are using structures that don't come with interleaving issues.

I remember reading about it in one of Martin Kleppmann’s papers, though I can’t remember which one.

It’s an ordering problem that comes from some of the simpler ordering algorithms. For Diamond types I’m using a variant of Yjs’s ordering. But even RGA doesn’t have this problem because each character’s insert location is specified by naming the character immediately to the left when that character was typed.

This repository implements a few different list CRDTs using an insertion sort approach, where the algorithm scans for the appropriate location every time an insert happens. This is the scanning function for RGA (automerge’s algorithm):

https://github.com/josephg/reference-crdts/blob/fed747255df9...

And this is an interactive visualisation of how diamond types works (which uses Yjs’s algorithm instead), complete with run-length encoding: https://home.seph.codes/public/diamond-vis/