Giter Club home page Giter Club logo

ecrdt's Introduction

This project is some experimentation with CRDT's in Erlang, please be aware that it's an experiment meaning not suitable for production use, not optimised for either speed or space and probably broken in some places.

The code is written to look nice, be understandable not to make the most out of every operation.

Consider yourself warned, now go have some fun with it!

Naming conventions

The first letter of the module name indicates what kind of CRDT the mudle implements:

  • m* - implements CmRDT's (message based)
  • v* - implements CvRDT's (state based)

Resources

ecrdt's People

Contributors

korny avatar licenser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ecrdt's Issues

`vorset2:merge/2` is not commutative and other bugs

So we at basho have been looking at your work (yay, CRDTs). We have a quickcheck suite for testing CRDTs, which we've been having success with (it's here, if you're interested: https://github.com/basho/riak_dt/blob/multi_crdt/test/crdt_statem_eqc.erl ).

Firstly, there are obvious bugs in your program. You treat the pairs in the values section at times as {Element, ID}, and at other times as {ID, Element}.

Secondly, your merge function does not commute. We wrapped your implementation in the same interface as we had, and it was failing our tests for equality, which have to be based on the fact that merge/2 commutes.

I rewrote the module into one with a deterministic, commutative merge function, but I'm not sure if it's the same algorithm as specified in the accompanying paper, so it may not be "optimised". My function also relies on the ordering of timestamps, which may be problematic.

My alterations to the module are here: https://gist.github.com/lenary/5755145 (I did quite a bit of a rewrite, to use ord{dict,sets} everywhere, to remove bugs, and to make merge/2 commute.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.