Giter VIP home page Giter VIP logo

delta_crdt_ex's Introduction

DeltaCrdt

Hex pm CircleCI badge

DeltaCrdt implements a key/value store using concepts from Delta CRDTs, and relies on MerkleMap for efficient synchronization.

There is a (slightly out of date) introductory blog post and the (very much up to date) official documentation on hexdocs.pm is also very good.

The following papers have been used to implement this library:

Usage

Documentation can be found on hexdocs.pm.

Here's a short example to illustrate adding an entry to a map:

# start 2 Delta CRDTs
{:ok, crdt1} = DeltaCrdt.start_link(DeltaCrdt.AWLWWMap)
{:ok, crdt2} = DeltaCrdt.start_link(DeltaCrdt.AWLWWMap)

# make them aware of each other
DeltaCrdt.set_neighbours(crdt1, [crdt2])

# show the initial value
DeltaCrdt.read(crdt1)
%{}

# add a key/value in crdt1
DeltaCrdt.mutate(crdt1, :add, ["CRDT", "is magic!"])

# read it after it has been replicated to crdt2
DeltaCrdt.read(crdt2)
%{"CRDT" => "is magic!"}

⚠️ Use atoms carefully : Any atom contained in a key or value will be replicated across all nodes, and will never be garbage collected by the BEAM.

Telemetry metrics

DeltaCrdt publishes the metric [:delta_crdt, :sync, :done].

Installation

The package can be installed by adding delta_crdt to your list of dependencies in mix.exs:

def deps do
  [
    {:delta_crdt, "~> 0.5.0"}
  ]
end

delta_crdt_ex's People

Contributors

derekkraan avatar frekw avatar dnsbty avatar dwmcc avatar evadne avatar flaviogrossi avatar jung-hunsoo avatar tegon avatar quinnwilton avatar hissssst avatar xinz avatar

Watchers

James Cloos avatar  avatar

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.