alex-shapiro / ditto Goto Github PK
View Code? Open in Web Editor NEWCRDTs for common data structures like maps, vecs, sets, text, and JSON
License: Apache License 2.0
CRDTs for common data structures like maps, vecs, sets, text, and JSON
License: Apache License 2.0
It would be nice if Site ID was not limited to u32
as a datatype, and instead could be anything that implements the traits needed to function. (I.e, Serde traits + Eq
and Hash
). I'm not sure how tightly coupled the implementation is to u32 at the moment.
This would allow a more decentralised approach at Site IDs, by using something such as a Random UUID to be used in place of a u32
Hi
Could you comment / compare ditto implementation with JSON CRDT paper ( PDF )?
Is it using same principles and algorithms or not? What are the differences?
There are Scala and Haskell implementations of JSON CRDT based on that paper:
Curious if this supports garbage collection concepts?
Should map_value
here not have the capacity of self
?
Lines 547 to 555 in c32f8e0
map_value.0.reserve(self.len());
A special Counter type for mutable numbers. Unfortunately, incrementing a raw number is not idempotent, so receiving duplicate increment ops on a raw number breaks consistency.
The most basic implementation of a counter is one that keeps track of its entire history; each increment has a (site,counter)
UID and duplicate increments have identical UIDs. The struct would look like this:
pub struct Counter {
value: f64,
history: Vec<UID>,
}
pub struct UID {
site: usize,
counter: usize,
}
pub struct Increment {
amount: f64,
site: usize,
counter: usize,
}
impl Counter {
pub fn increment(&self, amount: f64, replica: &Replica) -> Increment {
self.value += amount;
history.push(UID{site: replica.site, counter: replica.counter});
Increment{amount: amount, site: replica.site, counter: replica.counter}
}
}
Using BTree instead of Vec will improve performance when editing large arrays.
Just found this cool library. Thanks for the awesome work you've put into it!
I'm relatively new to the ideas underlying CRDTs but having a great time digging into various research papers and other sources on the subject. I plan to dig into your code more deeply soon, but was wondering if you could provide any additional information about how the CRDTs are implemented in this library from a high level? For example, in the readme, you mention "As long as ops from a site are executed in the order they were generated, the CRDT will maintain consistenct." Does that mean that this library is built out using CmRDTs and that I have to guarantee delivery order over my transport?
Thanks in advance!
I'd love to use this with a JavaScript front-end. Any recommendations for having it work with a JavaScript client over HTTP?
Also, are you basing this library on CvRDTs (convergent replicated data types) or CmRDTs (commutative replicated data types)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.