Coder Social home page Coder Social logo

gwint / mystore Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 295 KB

A distributed, in-memory key-value store written in C++

License: MIT License

Python 22.90% CMake 3.98% C++ 72.96% Dockerfile 0.16%
consensus-algorithm raft cpp python3 distributed-systems key-value-store mit-license

mystore's Introduction

MyStore is a distributed key-value store for string storage. It is a decentralized system that consists of processes, called nodes, running on serveral machines. MyStore is written in C++ and utilizes the Apache Thrift for remote procedure calls. The RAFT consensus algorithm is used to manage the replicated log that holds the mappings stored within the system. See the below resources for more information about RAFT:

Requirements

  • C++ >= 14
  • cmake >= 3.17.2
  • Python >= 3.7 (used for command line tool)
  • Apache Thrift version >= 0.13.0
  • A Github Account (to pull in external projects used for logging and .env file reading during build)

Installation

$ git clone https://github.com/gwint/mystore.git
$ cd mystore
$ mkdir build
$ cd build
$ cmake ..
$ make

Repeat these steps on each machine that will be apart of the MyStore cluster.

Start up and interact with a MyStore cluster

While inside the mystore directory, runnning ./build/MyStore will start a MyStore node listening on a port represented by . Once this has been done on all machines whose information is included in cluster.membership, a command line tool can be used to start the cluster's operation and store/retrieve mappings from the cluster. For example, the following commands will start the cluster, store a key-value pair within the cluster, and then retrieve the value associated with the stored key:

$ ./mystore start
$ ./mystore put -target=127.0.1.1:5000 akey aval
$ ./mystore get akey

Notice that the -target option is used on the call to put: this is because the mystore client does not keep information about the cluster members. Instead it builds up an understanding of the cluster over time as it interacts with it. As as a result, the first command run using the mystore command line tool must specify a socket address to use as the target for the command. Subsequent command do not require use of the target option.

mystore's People

Contributors

gwint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

deyili

mystore's Issues

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.