Giter Site home page Giter Site logo

floyd's Introduction

Floyd 中文

Floyd is an C++ library based on Raft consensus protocol.

  • Raft is a consensus algorithm which is easy to understand;
  • Floyd is an library that could be easily embeded into users' application;
  • Floyd support consistency between cluster nodes by APIs like Read/Write/Delete;
  • Also we support direct access to data without consistency: DirtyRead/DirtyWrite;
  • Also some query and debug managment APIs: GetLeader/GetServerStatus/set_log_level

Users

  • Floyd has provided high available store for Meta cluster of Zeppelin , which is a huge distributed key-value storage.
  • The list will goes on.

Why do we prefer a library to a service?

When we want to coordinate services, ZooKeeper is always a good choice.

  • But we have to maintain another service.
  • We must use its' SDK at the same time.

In our opion, a single service is much more simple than two services. As a result, an embeded library could be a better choice.

Floyd's Features and APIs

type API Status
Consensus Read support
Consensus Write support
Consensus Delete support
Consensus Lock working
Consensus UnLock working
Consensus GetLease working
Local DirtyRead support
Local DirtyWrite support
Query GetLeader support
Query GetServerStatus support
Debug set_log_level support
  • Raft fetaures
Language Leader election + Log Replication Membership Changes Log Compaction
C++ Yes No No

Compile and Have a Try

  • Dependencies

    • gcc version 4.8+ to support C++11.
    • protobuf-devel
    • snappy-devel
    • bzip2-devel
    • zlib-devel
    • bzip2
    • submodules:
    1. Get source code and submodules recursively.
git clone --recursive https://github.com/Qihoo360/floyd.git
    1. Compile library make
    1. Compile example make test
    1. run example/server groups
cd exampler/server
./output/bin/floyd_node --servers 127.0.0.1:9100,127.0.0.1:9101,127.0.0.1:9102 --local_ip 127.0.0.1 --local_port 9100 --sdk_port 8900 --data_path ./node1/data --log_path ./node1/log
./output/bin/floyd_node --servers 127.0.0.1:9100,127.0.0.1:9101,127.0.0.1:9102 --local_ip 127.0.0.1 --local_port 9101 --sdk_port 8901 --data_path ./node2/data --log_path ./node2/log
./output/bin/floyd_node --servers 127.0.0.1:9100,127.0.0.1:9101,127.0.0.1:9102 --local_ip 127.0.0.1 --local_port 9102 --sdk_port 8902 --data_path ./node3/data --log_path ./node3/log
    1. run client
# ./floyd_client
Usage:
  ./client --server ip:port
           --cmd [read | write | delete | status | debug_on | debug_off]
           --begin id0 --end id1
# ./floyd_client --server 127.0.0.1:8901 --cmd status --begin 0 --end 1

Documents

Contant us

floyd's People

Contributors

flabby avatar catkang avatar baotiao avatar kernelmaker avatar wenduo avatar

Watchers

zoujiaqing avatar James Cloos 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.