Remix.run Logo
gritzko 5 days ago

The big idea behind CRDTs is that a data structures can have replicas synchronizing on a best-effort basis. That is much closer to the physical reality: server here, client there, phones all over the place.

The basic CRDT ideas are actually pretty easy to implement: add some metadata here, keep some history there. The difficulty, for the past 20 years or so, is making the overheads low, and the APIs understandable.

Many projects revolve around some JSON-ish data format that is also a CRDT:

- Automerge https://automerge.org (the most tested one, but feels like legacy at times, the design is ~10yrs old, there are more interesting new ways)

- JsonJoy https://jsonjoy.com/

- RDX (mine) https://replicated.wiki/ https://github.com/gritzko/go-rdx/

- Y.js https://yjs.dev/

Others are trying to retrofit CRDTs into SQLite or Postgres. IMO, those end up using last-write-wins in most cases. Relational logic steers you that way.

petralithic 4 days ago | parent [-]

Could you explain more about Automerge being legacy? They recently released a new major version and revamped their algorithm I believe. What is better about your version?

gritzko 3 days ago | parent [-]

Automerge is based on design decisions from 2014-2017. I remember that epoch and what everybody thought back then. The views have evolved since, but Automerge is a large project, many things have being built on top. It is unrealistic to change any of the basic assumptions at this point.

I may go into the technical details, assuming my hourly rate is respected.

diarrhea 3 days ago | parent | next [-]

Go on. I respect your hourly rate.

petralithic 3 days ago | parent | prev [-]

How is your version better?

gritzko 3 days ago | parent [-]

That's a long list.

- RDX has a spec, so it can have compatible implementations. The result of a merge is specified to a bit. Automerge works the way Orion coded it (this time).

- There are equivalent text and binary formats, JDR and RDX.

- RDX palette of types is richer. Automerge is narrower than JSON.

- RDX can work in any commodity LSM db, natively, in the core (and it does).

- and so on...