Git Product home page Git Product logo

enforced_invariant_confluence's Introduction

Invariant Confluence

Strong consistency allows programmers to ignore many of the complexities of a distributed system, treating it as if it were running on a single machine. However, enforcing strong consistency requires coordination, and coordination leads to unavailability (at worst) or increased latency (at best). However, coordination cannot always be avoided. Certain application invariants require coordination in order to be globally enforced. Bailis et al. developed the notion of invariant-confluence as a necessary and sufficient condition for coordination freedom. Intuitively, a replicated object (with some start state and set of transactions) is invariant-confluent with respect to some invariant if the replicated object never takes on a value that violates the invariant. Bailis characterized many common invariants (e.g. uniqueness constraints, foreign key constraints), showing which could be maintained without coordination. However, this characterization required hand-written proofs. This research project expands on Bailis' research in two ways. First, we design a decision procedure to algorithmically determine when an object is invariant-confluent. Second, we develop segmented invariant-confluence: a generalization of invariant-confluence. This repository contains some documentation describing the research and accompanying implementations of the stuff described in the documentation.

Decision Procedure

Our decision procedures require python version >= 3.6. We recommend creating a conda environment to work in:

$ conda create --name iconfluence python=3.6
$ source activate iconfluence

Then, pip install the dependencies

$ pip install -r requirements.txt

Then, install z3 and z3py. Unfortunately, z3py is not pippable, so you'll have to install it by hand.

$ cd $HOME
$ git clone https://github.com/Z3Prover/z3
$ cd z3
$ python scripts/mk_make.py --python
$ cd build
$ make
$ sudo make install
$ echo 'export PYTHONPATH="$PYTHONPATH:$HOME/z3/build/python"'

Then, play with the examples in examples/.

$ PYTHONPATH+=:. python -i -m examples.all_datatypes
$ PYTHONPATH+=:. python -i -m examples.auction
$ PYTHONPATH+=:. python -i -m examples.bank_deposit_and_withdraw
$ PYTHONPATH+=:. python -i -m examples.bank_deposit_only
$ PYTHONPATH+=:. python -i -m examples.foreign_key
$ PYTHONPATH+=:. python -i -m examples.subsets
$ PYTHONPATH+=:. python -i -m examples.two_ints

Runtime

Our runtime requires C++14 or newer. First, install glog, protobuf, the protobuf compiler. On Ubuntu 14.04, this can be done as follows:

$ # Use a newer version of protobuf than is otherwise provided.
$ sudo add-apt-repository ppa:maarten-fonville/protobuf
$ sudo apt-get update
$ sudo apt-get install -y libgoogle-glog-dev libprotobuf-dev protobuf-compiler

Then, install libuv:

$ cd $HOME
$ git clone https://github.com/libuv/libuv
$ cd libuv
$ sh autogen.sh
$ ./configure
$ make
$ make check
$ sudo make install

and make sure that /usr/local/lib is on your LD_LIBRARY_PATH by adding something like export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" to your ~/.bashrc.

Then, cd into the lucy directory and run make (or make DEBUG=0 or make VERBOSE=1). Note that the code refers to segmented invariant-confluence as stratified invariant-confluence. The name's are different, but they are 100% the same thing.

enforced_invariant_confluence's People

Contributors

mwhittaker avatar jhellerstein avatar

Stargazers

Agost Biro avatar Maxwell Clarke avatar Jeremy Taylor avatar Mark Asp avatar Cheng Kuan avatar

Watchers

 avatar  avatar Chenggang Wu 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.