Code Monkey home page Code Monkey logo

cmsc624project's Introduction

Shuk

A pay-per-query data marketplace

Advanced Database Design - Final Project (Fall 2019)

Dependencies

Of note, you will need docker, docker-compose, and some postgres client tools like psql and pg_isready.

Running the demo

To spin up networked containers for the coordinator and multiple contractors, run the following:

make run CONTRACTORS=3

The coordinator will have read access to any tables on contractor_X under schema contractor_X. You can connect a client to the coordinator by running:

make psql-coordinator

To execute a query that will compute query cost and payouts, use the following dummy example:

select * from pay_per_query(
    'select a.id, b.id, add_sources(a.source, b.source) as source
    from contractor_1.bleep a join contractor_2.bloop b on true'
) as t(id1 int, id2 int, source jsonb);

...where bleep and bloop are valid table names. As done above, the source column must be selected--and potentially, concatenated using add_sources, or aggregated using agg_source--in every query/subquery.

To spin down:

make stop

Development

Cost parameters may be tuned in the pay_per_query function located in ./src/coordinator/superuser.sql

If you make changes to the Dockerfiles or initialization files, you'll need to rebuild before running again

make build

For convenience, you quickly spin down any existing containers, re-build, and re-run using the following:

make retry  # or alternatively `make retry CONTRACTORS=4`

Check out the Makefile for other commands/shortcuts.

Resources

cmsc624project's People

Contributors

adamhamlin avatar dfirer avatar

Watchers

 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.