GithubHelp home page GithubHelp logo

rboulton / diy-dist-db-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seeemilyplay/diy-dist-db-python

0.0 1.0 0.0 84 KB

Part of the SPA 2015 Distributed Databases session.

Python 100.00%

diy-dist-db-python's Introduction

Part of the SPA 2015 Distributed Databases session. Start here if you'd like to do the workshop in Python. This project will set you up with all the boring code that talks to a node via its REST API. At the moment this code can only talk to one node, it's your job to make it work with multiple, distributed nodes.

Running

Install the requests package that is used for dealing with http requests.

pip install requests

Start up at least one node with:

diy-dist-db-node 8080

Run the Python program with:

python dist-db/main.py

What's here

All code is in the dist_db directory. There are four files:

  1. thing.py: Defines the class Thing that represents the things stored in the db.
  2. node.py: A module that wraps around the node's REST API and deals with the HTTP calls for you.
  3. dist_db.py: Contains all the distributed logic for reading and writing across multiple nodes. Your code will go here.
  4. main.py: A simple script that tries out the database by reading and writing values. You may want to change this too.

Writing code

As mentioned above, most of your code will be in dist_db.py, but you may also want to change the main.py too.

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.