alex-shapiro / ditto

CRDTs for common data structures like maps, vecs, sets, text, and JSON
Apache License 2.0
475 stars 22 forks source link

pairing with a JavaScript library? #100

Open greglearns opened 6 years ago

greglearns commented 6 years ago

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)?

alex-shapiro commented 6 years ago

Right now there's no JS counterpart to Ditto. However, it should be possible to compile Ditto to WebAssembly with Rust's wasm32-unknown-unknown target, and one of my medium-term goals is to write a more ergonomic JS wrapper for the wasm output.

Ditto CRDTs are hybrids, that is, both CvRDTs and CmRDTs. You can replicate ops or changes as you see fit (via execute_op or via merge). Each form of replication comes with its own advantages and drawbacks. Op-based replication is typically more bandwidth-efficient but forces some restrictions on ordering (more in the README). State-based replication via state is typically less efficient, but it has no ordering restrictions.

mbalex99 commented 6 years ago

I'm very much interested in helping to contribute a JS-WASM effort!