Coder Social home page Coder Social logo

conflux's Introduction

Build Status GoDoc

conflux - Distributed database synchronization

Conflux synchronizes data by unique content-addressable identifiers. It does this by representing the entire set of identifiers with a polynomial. The difference between the databases is represented as a ratio of these polynomials. However, the polynomials are very large, since they represent every identifier in the database. The difference between databases is communicated by evaluating the difference ratio at a number of constants. Through the magic of rational function interpolation, the difference ratio can be reconstructed from these data points.

This algorithm is described in the papers, "Set Reconciliation with Nearly Optimal Communication Complexity" and "Practical Set Reconciliation".

The reconciliation algorithm are released under the GNU General Public License version 3. The reconciliation network protocol and prefix tree data storage interfaces are released under the Affero General Public License version 3.

Usage

Conflux API is versioned with gopkg. Use in your projects with:

import "gopkg.in/hockeypuck/conflux.v2"

Copyright (c) 2012-2015 Casey Marshall [email protected]

conflux's People

Contributors

bjmgeek avatar cmars 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

Watchers

 avatar  avatar  avatar  avatar

conflux's Issues

Finite field library spin-off?

Seems like polynomials over finite fields could be useful in other applications. Maybe we should spin these off into a separate library?

Configurable finite field modulus

conflux.recon and its subpackages are hardcoded to use a constant prime from SKS for the finite field in which all arithmetic occurs. This modulus is designed for enclosing 128-bit MD5 values.

conflux could be made configurable to support arbitrary finite fields for enclosing larger keys. This would allow content-addressable key synchronization with larger, more secure, FIPS-compatible hashes: SHA1, SHA2 family & beyond.

Prefix tree should ignore duplicate keys on Peer.Insert, missing keys on Peer.Remove

Need to make the prefix tree more resilient, so that users of the recon library do not need to track the existing state of the tree.

Insert should add a *Zp key only if the key is not already present in the tree. Likewise, Remove should remove the *Zp key only if the key exists in the tree. Otherwise, these methods should do nothing -- or better yet, they could return the status of the key.

In order to implement this, we'll need to record a breadcrumb trail of operations to apply to the parent nodes where a key is inserted or removed, and only apply them if the operation is valid w.r.t the prefix tree contents.

API review, cleanup

Zp and Poly APIs feel kind of fugly. I basically just copied what I saw in big.Int. Could it be better?

Eliminate recursion

Go is not TCO, need to replace recursive methods with looping and explicit stacks.

Config message not handshaking with SKS

conflux:

  00000000  0a 00 00 00 05 00 00 00  07 76 65 72 73 69 6f 6e  |.........version|
  00000010  00 00 00 0c 65 78 70 65  72 69 6d 65 6e 74 61 6c  |....experimental|
  00000020  00 00 00 09 68 74 74 70  20 70 6f 72 74 00 00 00  |....http port...|
  00000030  05 31 31 33 37 31 00 00  00 0a 62 69 74 71 75 61  |.11371....bitqua|
  00000040  6e 74 75 6d 00 00 00 01  32 00 00 00 04 6d 62 61  |ntum....2....mba|
  00000050  72 00 00 00 01 35 00 00  00 07 66 69 6c 74 65 72  |r....5....filter|
  00000060  73 00 00 00 00                                    |s....|
  00000065

sks:

  00000000  00 00 00 70 0a 00 00 00  05 00 00 00 0a 62 69 74  |...p.........bit|
  00000010  71 75 61 6e 74 75 6d 00  00 00 04 00 00 00 02 00  |quantum.........|
  00000020  00 00 07 66 69 6c 74 65  72 73 00 00 00 0d 79 6d  |...filters....ym|
  00000030  69 6e 73 6b 79 2e 64 65  64 75 70 00 00 00 09 68  |insky.dedup....h|
  00000040  74 74 70 20 70 6f 72 74  00 00 00 04 00 00 2c 6b  |ttp port......,k|
  00000050  00 00 00 04 6d 62 61 72  00 00 00 04 00 00 00 05  |....mbar........|
  00000060  00 00 00 07 76 65 72 73  69 6f 6e 00 00 00 05 31  |....version....1|
  00000070  2e 31 2e 33                                       |.1.3|

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.