Giter Club home page Giter Club logo

python-chord's Introduction

python-chord

Python implementation of this paper.

Its base class is Local, located in chord.py. It provides the overlay network and a lookup operation. Other commands such as 'get' or 'put' are provided by the top layers using Chord by registering those commands (take a look at dht.py). This provides enough flexibility to add replication, re-distribution of keys/load, custom protocols, etc.

Currently supports concurrent addition of peers into the network and can handle node failures / leave. Key lookup consistency test implemented in test.py.

The behaviour of the network can be greatly modified by setting the appropriate values on settings.py.

How to test?

  • $>python test.py to check consistency. Tests can fail due to the fact that the network is not stable yet, should work by increasing the rate of updates.
  • $>python create_chord.py $N_CHORD_NODES to run a DHT that lets you ask questions to random members.

Distributed Hash Table

A distributed hash table implementation on top of Chord is available in dht.py. It uses the overlay network provided by Chord's algorithms and adds two more commands to the network, the commands set and get.

After registering those commands with the appropriate callbacks we have a fairly simple DHT implementation that also balances loads according to node joins.

To be implemented:

  • Replication to handle node failures/departures without losing information.

Distributed File System

For this case we implemented a file system ... (to be continued)

How to test?

  • $>python create_chord.py $N_CHORD_NODES, followed by $>python dfs.py $MOUNT_POINT. Read description on dfs.py to know how to operate.

What's next?

  • Add replication!
  • Adaptative load balance, based on this paper.

DISCLAIMER Pet project for fun to learn about DHT's, not intended to be used in real life.

Other projects:

  • SOON: C++ implementation of Raft concencus protocol.

python-chord's People

Contributors

gingaramo avatar

Watchers

 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.