Giter Site home page Giter Site logo

ryogrid / funnelkvs Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 1.0 931 KB

Rust implementation of autonomous distributed key-value store which has REST interfaces

Home Page: https://github.com/ryogrid/rust_dkvs/blob/master/ARCHITECTURE.md

License: MIT License

Rust 48.91% Python 26.74% RenderScript 22.50% Go 1.80% Batchfile 0.02% Shell 0.02%
rust dht chord kvs database db distributed-system python rest-api distributed-database golang go

funnelkvs's Introduction

FunnelKVS: Rust implementation of autonomous distributed key-value store which has REST interfaces

What is Funnel?

Distributed KVS

  • Architecture (Japanese)

  • Referenced site (about REST API implementation. first one is Japanese)

  • Fault torelance

    • in-memory DB with no persistance (file storage is not used)
    • data replication is implemented
    • functionality for keeping network healthy at occuring node down is also implemented
  • Data consistency

    • care for data consistency is not enough yet...
    • First, running test on occring node downs and joins condition is planned
  • How to execute node daemon

    • $ curl https://sh.rustup.rs -sSf | /bin/bash -s -- -y --default-toolchain stable
    • $ rustup update && cargo update
    • $ rustup install nightly-2021-07-29
    • $ rustup override set nightly-2021-07-29
    • $ cargo build --release
    • $ target/release/rust_dkvs [born_id: 1...N] [IP addr to bind] [Port number to bind] [IP addr of medietor] [Port number of medietor] [log output path: currently not referenced]
  • Setup KVS system

    • launch example of node daemons which compose KVS system
      • you can build KVS system which is composed of multiple machines if you place rust_dkvs program binary to the machines and kick these with some tool like SSH
        • procedures wrote below are single machine example for easy trying
      • born_id of first node must be 1 but born_id of other node has no restriction except thst 1 can't be used
        • 1 can be used by first node only
      • IP address and port number has no restriction but all nodes should be able to communicate directly with each other
    • $ target/release/rust_dkvs 1 127.0.0.1 11000 127.0.0.1 10999 ./
    • $ target/release/rust_dkvs 2 127.0.0.1 11001 127.0.0.1 11000 ./
    • $ target/release/rust_dkvs 3 127.0.0.1 11002 127.0.0.1 11000 ./
    • ....
  • REST interfaces which are offered by KVS system

    • for easy testing with Web browser or something (use http GET request)
      • http://[node addr]:[node_port]/global_put_simple?key=[string only includes ascii character]&val=[string only includes ascii character]
      • http://[node addr]:[node_port]/global_get_simple?key=[string only includes ascii character]
      • http://[node addr]:[node_port]/global_delete_simple?key=[string only includes ascii character]
    • for using from code or HTTP client tool (use http POST request to send JSON text)
      • Data should be appropriately escaped as JSON string and charactor code should be UTF-8
      • "Content-Type" header's value should be "application/json"
      • http://[node addr]:[node_port]/global_put
        ใ€€ - body at POST -> { "key_str" : "[charactors]", "val_str" : "[charactors]" }
      • http://[node addr]:[node_port]/global_get
        ใ€€ - body at POST -> "[key charactors]"
      • http://[node addr]:[node_port]/global_delete
        • body at POST -> "[key charactors]"
  • Utility CLI tool (tools/dkvs_client.go)

    • setup chord network (on local machine)
      • $ go run -op=setup-nodes -arg1=[launch nodes num]
    • KVS system network health check
      • $ go run -op=check-chain
      • if the network is helthy, launched or alive nodes (process) are listed without duplication
    • testing put values to KVS via specified node
      • $ go run -op=put-test-values -arg1="127.0.0.1:11000"
      • put 100 values
      • node you specify with arg1 has no restiction like that local addresses can be only specified. above is example
    • testing get already put values from KVS via specified node
      • $ go run -op=get-test-values -arg1="127.0.0.1:11005"
      • get 100 values

Simulator of distributed KVS (chord_sim dir)

  • design verification with simulator wrote by Python (verification is finished)
    • you can simulate distributed kvs working behavior. on the simulation put, get, stabilize, join operations are issued continuously on node downs and node joins occuring condition.

Simulator of distributed KVS (chord_sim_rust dir)

  • design verification with simulator wrote by Rust (verification is finished)
  • Rust implemantation of chord simulator can be executed like below
    • $ curl https://sh.rustup.rs -sSf | /bin/bash -s -- -y --default-toolchain nightly
    • $ rustup override set nightly
    • $ rustup update && cargo update
    • $ cd chord_sim_rust
    • $ cargo run

Runnable platforms for KVS system (= you can build the daemon binary for the platform)

  • Windows native
    • dev env is also OK
  • MacOS
    • dev env is also OK
  • Linux (and Windows Subsystem for Linux environment)
    • dev env is also OK
    • probably ...
  • other UNIX like OS environments
    • please try!

funnelkvs's People

Contributors

ryogrid 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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

inutano

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.