This is the prototype implementation of the Inconsistent Performance-bound Approximate (IPA) programming model and storage system. This is part of the Disciplined Inconsistency project, which aims to make it safe to trade off consistency for performance in highly available applications built on top of replicated & distributed datastores.
The prototype implementation is built on top of Cassandra in Scala, using Outworkers' Phantom library to connect with Cassandra. The project is organized and built with SBT (v0.13).
To learn more, read a blog post explaining the high-level motivation for the project, or the latest draft of the paper under submission, available currently as a tech report.
/src
: IPA source code (sbt project)ipa
: Core IPA codeipa.types
: IPA Type system, implemented as higher-kinded Scala typesipa.adts
: Data structures implemented with support for IPA annotations. A good example ADT to look at isIPASet
, which usesRushCommon
to implementLatencyBound
and aReservationPool
to implementErrorBound
.ipa.apps
: Applications built using IPA types- RawMix: Microbenchmark which does random mix of IPASet operations
- RawMixCounter: Microbenchmark like RawMix but with IPACounter ops
- Retwis: Twitter clone
- TicketSleuth: Ticket sales service
experiments.py
: Script to run parameter sweeps for each of the test appsswarm.py
: Helpers to create a Docker Swarm instance and setup IPA jobs (Cassandra+ReservationServer containers + Client containers)honeycomb.py
: Helpers that setup containers with simulated adverse network conditions usingtc netem
. Conditions for our experiments are defined inhoneycomb.yml
.
This code has not been specifically streamlined to make it easy for others to run. However, it should be fairly straightforward given that most of it runs inside Docker, which is a standardized environment. The trickest part is usually getting the Docker Swarm configured correctly (this code was written and test in Docker v1.11, before Docker's new orchestration support was unveiled, so this process may be much simpler now).
Basic workflow to run the code should go as follows:
- Install Java v8+, Scala v2.11, and SBT v0.13+.
- Ensure it builds correctly with
sbt compile
- Launch a Swarm:
- Edit MASTER and AGENTS in
swarm.py
with hostnames of machines which must:- Be able to be ssh'd to
- Not require a password to sudo
- Have Docker v1.11 (or newer?) installed
- Run
./swarm.py up
- Cross your fingers.
- Edit MASTER and AGENTS in
- Run an IPA job with
./experiments.py ...
- See script to decipher the available options, or contact me.