Code Monkey home page Code Monkey logo

database-as-a-service's Introduction

Deploy para dev

# para saber sua tag:
make get_last_tag ENV=DEV

# para fazer o deploy
make gcp_deploy_dev TAG=XXX

Para desenvolvimento local, use o docker

se for desenvolvimento local, entre na pasta de dev e use o makefile dentro desta pasta

Old? Revisar??

Run Tests codecov

Database as a Service (DBaaS)

Introduction

This is an implementation of a database as a service api written in python + django. It will try to follow some hypermedia concepts throughout the api calls.

Below: Screenshot from the admin user.

image 1: Listing databases and their summary information.

Listing databases and their summary information

image 2: example database view and all its credentials.

alt text

Requirements

DBaaS requires the following:

  • python >= 2.7.5
  • virtualenv >= 1.7.2
  • virtualenvwrapper >= 3.5
  • mysql server and client, version 5.5.x
  • mongo client = 2.4 (used by the clone feature)
  • redis (broker for async tasks with celery)
  • and all packages in requirements.txt file (there is a shortcut to install them)

Setup your local environment

Using docker (recommended)

Setup docker and docker-compose

Go to the project path and run these following commands:

# create python container
$make dev_docker_build
$make dev_docker_setup [optional_mysql_dump_file_path]
$make dev_docker_migrate 
$make dev_docker_run

To generate a migration, you should run:

 $make dev_docker_generate_migration app=my_app

And then, to apply the changes to the bank:

$make dev_docker_migrate 

You can explore spacific docker settings in this link

without docker

mkvirtualenv dbaas
workon dbaas

Install the required python packages by:

make pip

Database setup for migrations:

  1. Connect to the local database.

     mysql -u root -p <GENERATED-PASSWORD>
    
  2. Change root password to an empty string.

     ALTER USER 'root'@'localhost' IDENTIFIED BY '';
    
  3. Create dbaas database.

     CREATE DATABASE dbaas;
    

Run migrations to mysql database:

make run_migrate

Install redis and start celery:

make run_celery

Create the tables structure (see the next item)

DB

DBaaS uses south to maintain the migrations up-to-date. However, you can just run syncdb to create the table structures. There is a shortcut to help you with that, including some minimum operational data on DB.

make reset_data

Running all tests on local environment

make pip && make test

Running all test with docker( To run this the docker-compose must be available)

make docker_build && make test_with_docker

Running the project

make run

In your browser open the URL: http://localhost:8000/admin/

Running celery

To run celery locally use the following command:

cd {APP DIR}
make run_celery

Documentation

Listed below are some articles that describe details associated with this project.

This guide will help you to understand the basic DBaaS architecture.

The running instructions in the execution order.

The documentation of API which allows you to maintain yours databases.

About drivers used to support to new databases.

Guide to avoid usual problems.

Guide to use this project with containers.

License

This project is licensed under the BSD 3-Clause "New" or "Revised" License - read LICENSE file for details.

database-as-a-service's People

Contributors

akira-miyazato avatar andrewsmedina avatar anitavincent avatar ccasado avatar djoker avatar edulh avatar elesbom avatar elesbom2 avatar eliakincosta avatar erkmann avatar felippemr avatar gustavosoares avatar iagohtavares avatar karenteixeira avatar kenjiyamamoto avatar lefreire avatar limadiego avatar lsouza avatar manasi2001 avatar mbergo avatar mborgescc avatar nimbfire avatar nvmoreira avatar otherpirate avatar ricardosdias avatar slemus29 avatar tayanemoura avatar thiulle avatar wmarquardt avatar ylgnerbecton 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  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  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  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  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  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  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

database-as-a-service's Issues

google analytics

track user visitors with google analytic

hint: django-ganalytics

API function: Status database

Check status of database and instance
For database, check if database is created or not.
For instance, check if instance is accessible/alive (mongo ping command)

Sorting wrong

It is not possible to sort database by environment in database change view.

Authorization

Dbaas must support two roles: regular user and DBA.
Regular user:

  • must see only databases of your own team
  • when a database is deleted, it must be put in quarantine and user can see that database anymore.
    DBA: have same rules as user +
  • can see all databases
  • can delete (physically) a database in quarantine.
  • can move a database from quarantine to working again.
  • can manage DatabaseInfra, can create plans etc...

behavior on existing credentials and database

For engine driver, when a database or credential exist, an exception will be raise. This is important to keep all driver with same functionality.
For the whole system, when a database exists, consider that is ok and when a user exists, change password and roles.

Support to tagging

Allow instance (maybe other models) support tagging.
Tagging must be used to filter dashboard and admin

improve profile page

Give a little bit of more information in the user profile page, such as the environment and plan of a given database.

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.