TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Building a BFT JSON CRDT

205 pointsby raykyriover 2 years ago

12 comments

samwillisover 2 years ago
It&#x27;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 (&quot;outside&quot; the network) who have MITM the connection. These are really great problems to solve.<p>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&#x27;t have a way to handle, say, the maximum length of an array&#x2F;string, or minimum and maximum values for a number. They leave this to the application using the toolkit.<p>For the Yjs + ProseMirror system, effectively the CRDTs are resolved outside of ProseMirror. Thats useful as they can be combined&#x2F;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.<p>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&#x2F;string, or what the maximum value of a number is. Effectively generic CRDTs that have an understanding of developer supplied rules and bounds.<p>The &quot;maximum length&quot; is an interesting one, as depending on the order of transactions you could end up with a different result.
评论 #33697278 未加载
评论 #33697451 未加载
评论 #33696727 未加载
simonwover 2 years ago
&gt; I write this blog post mostly as a note to my past self, distilling a lot of what I’ve learned since into a blog post I wish I had read before going in<p>The best kind of blog post!
adamdustyover 2 years ago
For people like me:<p>BFT - Byzantine Fault Tolerant [0]<p>CRDT - Conflict-free Replicated Data Type [1]<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Byzantine_fault" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Byzantine_fault</a><p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Conflict-free_replicated_data_type" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Conflict-free_replicated_data_...</a>
评论 #33697056 未加载
评论 #33696473 未加载
评论 #33697040 未加载
thrufloover 2 years ago
From the article, this appears to be an implementation of Making CRDTs Byzantine Fault Tolerant [0] in Rust [1].<p>[0]: <a href="https:&#x2F;&#x2F;martin.kleppmann.com&#x2F;papers&#x2F;bft-crdt-papoc22.pdf" rel="nofollow">https:&#x2F;&#x2F;martin.kleppmann.com&#x2F;papers&#x2F;bft-crdt-papoc22.pdf</a><p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;jackyzha0&#x2F;bft-json-crdt" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jackyzha0&#x2F;bft-json-crdt</a>
jitlover 2 years ago
I&#x27;m quite surprised by the [benchmarks versus Automerge JS &amp; Rust](<a href="https:&#x2F;&#x2F;github.com&#x2F;jackyzha0&#x2F;bft-json-crdt#benchmarks" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jackyzha0&#x2F;bft-json-crdt#benchmarks</a>) when it comes to memory:<p>&gt; Ours (Basic) 27.6MB<p>&gt; Ours (BFT) 59.5MB<p>&gt; Automerge (Rust) 232.5MB<p>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?<p>&gt; Ops: 100k<p>&gt; Ours (Basic) 9.321s<p>&gt; Ours (BFT) 38.842s<p>&gt; Automerge (Rust) 0.597s
Karrot_Kreamover 2 years ago
Hash graph reconciliation is generally the harder part of this problem as noted in future work, but this is a very exciting direction.
评论 #33696299 未加载
MWilover 2 years ago
when you see it...them...
评论 #33695477 未加载
lukeigelover 2 years ago
Let&#x27;s go Jackie!!!
EGregover 2 years ago
Yessss finally someone is doing it.
barbazooover 2 years ago
That was a bit creepy while it lasted. (the mouse pointer thing that is)
recuterover 2 years ago
To somebody who knows Erlang, isn&#x27;t this reinventing the wheel basically?
评论 #33696491 未加载
评论 #33696530 未加载
评论 #33696471 未加载
PointyFluffover 2 years ago
A little early in the morning for so much alphabet soup.
评论 #33695692 未加载