Code Monkey home page Code Monkey logo

airbnbweb-with-paxos's Introduction

Airbnb Server with Paxos

AirbnbServer is a simple housing search & reservation system that uses Paxos algorithm as its core replication functionality. Users will be able to register, log in, search for housing and then make the reservations by selecting the house(s) they like. In particular, we used Paxos nodes as a distributed backup as well as a mechanism to reach eventual consensus--- especially where there are lots of participating user nodes.

AUTHORS (alphabetical order):
  • Shaojie (Jerry) Bai
  • Zirui (Edward) Wang

This project also server as the application layer of CMU 15-440: Distributed System p3. To see more: CMU 15-440 p3

The goal of this project is to apply the idea of paxos algorithm to real life problems. In fact, paxos algorithm turns out to be of great use in our Airbnb Server because it can ensure consistency across the several data storage nodes. More importantly, it guarantees a high level fault tolerance (wihout considering Byzantine failure) so that it will be very easy to recover.

Version

1.1.0

Technology

The programming languages involved are mainly Go (Golang), Javascript, HTML and CSS, with Bootstrap framework v3.3.5, which can be found at here. If offers a lot of components that are really useful, such as modals, cool buttons, etc. The interactive part is achieved mainly using Javascript's jQuery library. A typical ajax call serve as the communication "channel" between webview and handlers.

This project is made up of 4 layers in total:

  • The front-end webview. This is the part that directly interacts with the users. Most of the implementations were written in HTML, CSS and Javascript (jQuery).
  • The web controllers/handlers. These handlers are much like the controllers in the MVC model that directly deal with the view. However, they don't do any processing tasks. When the user perform certain kind of operations, it is then the job of the handlers to parse the request, serve as a proxy, and ask the back-end system for responses. Once it gets the result, it will render the view and display to the users.
  • The AirbnbNode. This is a para-centralized part of our system. A cluster of the web views connect to the same AirbnbNode. In addition, each AirbnbNode is connected to all the Paxos nodes. It serves in between the handlers and the Paxos nodes as a layer of indirection--- this offers a better interface usage and masks the Paxos calls from the front-end development. Once the AirbnbNode collects the information from handler(s), they start proposing to Paxos.
  • Paxos algorithm (nodes). Paxos nodes are responsible for the distributed backup. The AirbnbNode, once contacted and ready to Propose, will contact an arbitrary available Paxos node by first calling GetNextProposalNumber(). Then it will wrap the (key, value) pair in ar argument and RPC Propose() that each Paxos node supports. Once there is a success, Paxos node will pass the result back using RPC to the AirbnbNode (who will forward the reply upward in hierarchy).

Installation

You don't necessarily need to have Golang installed on your computer (though we recommend it). In /p3/bin folder and /p3/src/github.com/cmu440-F15/paxosapp/airbnbweb folders, we already had .exe file prepared for you.

You will first need to download our project from GitHub. Then, put it in your local directory where you put your Go, and set your GOPATH to this folder by

$ export GOPATH=$'your_path_of_download\p3'

(For example, if you downloaded to your local Windows directory "C:\Go", then do export GOPATH=$'C:\Go\p3'.

If you want to compile from scratch, then do the following:

$ cd $GOPATH/src
$ go install github.com/cmu440-F15/paxosapp/runners/arunner
...
$ cd $GOPATH/bin
$ ./arunner

After the steps above, you should have already had a bunch of Paxos nodes and AirbnbNodes running. Then you may want to open another terminal (or you can run ./arunner & to run in background), reset your GOPATH in a similar fashion, and do

$ cd $GOPATH/src/github.com/cmu440-F15/paxosapp/airbnbweb
$ go build airbnbWebsite.go
$ ./airbnbWebsite -=port=8080

In the last step, if you do not specify your own port, it will default to port ":8080".

Finally, you can open your web browser and type in localhost:8080/login/. From there, you will have access to the system!

Todos

  • UI (better interactions, more funcitonalities)
  • Testing
  • Lots of other things :)

airbnbweb-with-paxos's People

Contributors

jerrybai1995 avatar

Stargazers

 avatar Yang Wang avatar

Watchers

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