Giter VIP home page Giter VIP logo

paxi's Introduction

What is WPaxos?

WPaxos is a multileader Paxos protocol that provides low-latency and high-throughput consensus across wide-area network (WAN) deployments. Unlike statically partitioned multiple Paxos deployments, WPaxos perpetually adapts to the changing access locality through object stealing. Multiple concurrent leaders coinciding in different zones steal ownership of objects from each other using phase-1 of Paxos, and then use phase-2 to commit update-requests on these objects locally until they are stolen by other leaders. To achieve fast phase-2 commits, WPaxos adopts the flexible quorums idea in a novel manner, and appoints phase-2 acceptors to be close to their respective leaders.

WPaxos (WAN Paxos) paper (first version) can be found in https://arxiv.org/abs/1703.08905.

What is Paxi?

Paxi is the framework that implements WPaxos and other Paxos protocol variants. Paxi provides most of the elements that any Paxos implementation or replication protocol needs, including network communication, state machine of a key-value store, client API and multiple types of quorum systems.

Warning: Paxi project is still under heavy development, with more features and protocols to include. Paxi API may change too.

What is included?

How to build

  1. Install Go 1.9.
  2. Download WPaxos source code from GitHub page or use following command:
go get github.com/ailidani/paxi
  1. Compile everything.
cd github.com/ailidani/paxi/bin
./build.sh

After compile, Golang will generate 4 executable files under bin folder.

  • master is the easy way to distribute configurations to all replica nodes.
  • server is one replica instance.
  • client is a simple benchmark that generates read/write reqeust to servers.
  • cmd is a command line tool to test Get/Set requests.

How to run

Each executable file expects some parameters which can be seen by -help flag, e.g. ./master -help.

  1. Start master node with 6 replicas running WPaxos:
./master.sh -n 6 -protocol "wpaxos"
  1. Start 6 servers with different zone id and node ids.
./server -sid 1 -nid 1 -master 127.0.0.1 &
./server -sid 1 -nid 2 -master 127.0.0.1 &
./server -sid 2 -nid 1 -master 127.0.0.1 &
./server -sid 2 -nid 2 -master 127.0.0.1 &
./server -sid 3 -nid 1 -master 127.0.0.1 &
./server -sid 3 -nid 2 -master 127.0.0.1 &
  1. Start benchmarking client with 10 threads, 1000 keys, 50 percent conflicting commands and run for 60 seconds in 1 round.
./client -sid 1 -nid 1 -master 127.0.0.1 -T 10 -k 1000 -r 1 -c 50 -t 60 &

How to use implement algorithms in Paxi

Replication algorithm in Paxi follows the message passing model, where several message types and their handle function are registered.

  1. Define messages, register with gob in init() function if using gob codec.

  2. Define handle function for each message type.

  3. Register the messages with their handle function using Node.Register(interface{}, func()) interface.

For sending messages, use Send(to ID, msg interface{}), Broadcast(msg interface{}) functions in Node.Socket.

For data-store related functions check db.go file.

For quorum types check quorum.go file.

Client uses a simple RESTful API to submit requests. GET method with URL "http://ip:port/key" will read the value of given key. POST method with URL "http://ip:port/key" and body as the value, will write the value to key.

paxi's People

Watchers

Slice 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.