Giter Club home page Giter Club logo

pocdb's Introduction

Proof-of-Concept DB
===================

Proof-of-concept db is the answer to a question:  How long would it take to
build the basics of a Paxos-replicated database for fast prototyping purposes?

The answer is somewhere less than 3 hours because I'm not done the three hour
concert set I put on when I started, and this README has consumed about five
minutes of my time.  I did reuse some of my own code from elsewhere, but not
the core of the Paxos implementation (mainly messaging scaffolding and the
like).

How to test it
--------------

pocdb is a static, 5-node paxos cluster hard-coded to localhost.  Run five
instances of ./pocdb-daemon each in a separate directory.  Then execute the
included ./pocdb-load to throw data at it, or write a script using pocdb.h.

Key Features
------------

 * Paxos replication
 * Master-less:  any write can be sent to any server
 * Partitioned:  keys are not serialized through a single Paxos-backed log
   unlike in some other key-value stores (HyperDex and Consus excepted).
 * Servers can go offline if poc client is changed to be aware of offline
   servers (or to retry requests to online servers)
 * Fully durable to leveldb
 
What's Missing
--------------

Quite a bit, but I had a 3 hour limit:

 * Dynamic cluster:  servers are bound to localhost and hard coded
 * Consistent get:  should retrieve from a quorum and select largest value
 * Recovery on failure:  if a server fails and comes back, keys will be lazily
   be repopulated, but that server will have stale data for the interim; Paxos
   will hide this on write, (and get if that gets completed), but fault
   tolerance is reduced.
 * There are a couple of race conditions in the code

Should I use this in production
-------------------------------

Probably not.  That being said, telling someone not to use a random open
source project they find on GitHub in production is the most surefire way for
a single developer to make it into someone else's production stack.

Take a look at Consus (http://consus.io) instead for a more principled system.

Why?
----

Someone told me it would take six months after I said it was a week's effort
to prototype.  People also seem hesitant to look at Consus for its use of
Paxos, so this toy example gives people the ability to dig into how Paxos is
used without all the niceties in the way.

pocdb's People

Contributors

rescrv 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pocdb's Issues

Example of pocdb_get()

Can you show an example of using the pocdb_get() function? I used it using the following code:

            pocdb_client* c = pocdb_create();
            char* key = (char*)malloc(sizeof(char)*100);
            char **vals = (char **) malloc (sizeof (char *));
            *vals = (char *) malloc (sizeof(char)*100);
            size_t *val_len = (size_t *) malloc (sizeof(size_t)*20);
            cin>>key;
            if (pocdb_get(c, key, strlen(key), vals, val_len) != POCDB_SUCCESS)
            {
                std::cerr << "Get failure" << std::endl;
                return EXIT_FAILURE;
            }
            else
            {
                std::cout << "VALUE : " << *vals << std::endl;
            }

However, it prints a non-ASCII output. Like this.
VALUE : ���

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.