Live data from Hacker News

Building a BFT JSON CRDT

jzhao.xyz

11–20 of 38 posts

Re: Building a BFT JSON CRDT

#14

For people like me: BFT - Byzantine Fault Tolerant [0] CRDT - Conflict-free Replicated Data Type [1] [0] https://en.wikipedia.org/wiki/Byzantine_fault [1] https://en.wikipedia.org/wiki/Conflict-free_replicated_data_...

JSON - JavaScript Object Notation [0]

[0] https://en.m.wikipedia.org/wiki/JSON

Re: Building a BFT JSON CRDT

#15
post #12

To somebody who knows Erlang, isn't this reinventing the wheel basically?

Erlang is a great language and runtime to build distributed systems in but it doesn’t provide primitives to resolve concurrent overlapping updates.

Hence projects like https://www.antidotedb.eu (CRDT database in Erlang)

Re: Building a BFT JSON CRDT

#16
post #12

To somebody who knows Erlang, isn't this reinventing the wheel basically?

AFAIK Erlang isn't byzantine fault tolerant, doesn't use CRDTs, and doesn't even have a JSON library in its stdlib. So just from the title you can tell it has nothing to do with the article.

Re: Building a BFT JSON CRDT

#17
I'm quite surprised by the [benchmarks versus Automerge JS & Rust](https://github.com/jackyzha0/bft-json-crdt#benchmarks) when it comes to memory:

> Ours (Basic) 27.6MB

> Ours (BFT) 59.5MB

> Automerge (Rust) 232.5MB

I would expect adding the public key tracking to use more memory; I wonder how Automerge is spending so much more memory. Possibly on a bunch of internal caches or memoization that give the order-of-magnitude improvement in speed?

> Ops: 100k

> Ours (Basic) 9.321s

> Ours (BFT) 38.842s

> Automerge (Rust) 0.597s

Re: Building a BFT JSON CRDT

#18
It's the Byzantine Fault Tolerant part of this that is particularly innovative and based on Kleppmanns most recent work. I believe it solves the issue of either malicious actors in the networks modifying others transactions, spoofing them, or the messages being modified by third parties ("outside" the network) who have MITM the connection. These are really great problems to solve.

However, when I was experimenting with CRDTs a while back, it seemed to me the other big issue is where multiple transactions from different users combine to create an invalid state. Most CRDT toolkits are aiming for a combination of a JSON like type structure, with the addition on specific structures for rich text. The JSON structures for general purpose data, and those for rich text as that is the most common current use case. These sort of general purpose CRDTs don't have a way to handle, say, the maximum length of an array/string, or minimum and maximum values for a number. They leave this to the application using the toolkit.

For the Yjs + ProseMirror system, effectively the CRDTs are resolved outside of ProseMirror. Thats useful as they can be combined/resolved on the server without a ProseMirror instance running. However there is a strong possibility that the resulting structure is no longer valid for your ProseMirror Schema, this is currently handled by ProseMirror throwing away the invalid parts of the document when it loads.

What I think is needed is a Schema system that is a layer either on top of these toolkits, or as part of them, that provides rules and conflict resolution. So there is a way to specify the maximum length of an array/string, or what the maximum value of a number is. Effectively generic CRDTs that have an understanding of developer supplied rules and bounds.

The "maximum length" is an interesting one, as depending on the order of transactions you could end up with a different result.

Re: Building a BFT JSON CRDT

#19

It's the Byzantine Fault Tolerant part of this that is particularly innovative and based on Kleppmanns most recent work. I believe it solves the issue of either malicious actors in the networks modifying others transactions, spoofing them, or the messages being modified by third parties ("outside" the network) who have MITM the connection. These are really great problems to solve. However, when I was experimenting wi…

I think this is the schema system you're asking for: https://www.hyperhyperspace.org/

(specifically, the data representation part)

Re: Building a BFT JSON CRDT

#20

For people like me: BFT - Byzantine Fault Tolerant [0] CRDT - Conflict-free Replicated Data Type [1] [0] https://en.wikipedia.org/wiki/Byzantine_fault [1] https://en.wikipedia.org/wiki/Conflict-free_replicated_data_...

[deleted]
Post reply on HN