Giter Club home page Giter Club logo

myaas's Introduction

Docker Build Statu Docker Pulls Docker Automated buil

MyAAS (Mysql As A Service)

This product has been developed internally at habitissimo for allowing developers to get the database instances they need for development as fast as possible.

What this project does

This project consists on a service which will import a collection of databases periodically. This databases become templates for the final users.

An user can ask for a database instance from any template available and have it fully functional and loaded with data within seconds, no matter how big is the database, this databases can be destroyed at any moment to request a new instance with fresh data.

Speed

The main concern we where having in our development process was importing database backups in our development instances, loading this backups by tradicional means (importing a mysqldump file) could take almost an hour, we could use other metohds like innobackupex, but this would mean developers had to download huge files (even with compression) trading speed in import time by slownes in download time.

This solution is being used to provide a variety of databases ranging from a few megabytes up to several gigabytes, all of them are provisioned within seconds (something between 3 or 5 seconds).

How it works

You put your sql backups in a folder and run the updater command, this will import the databases and prepare them as templates. This is the slow part, we run it at nights so developers can have acces to yesterday's data in the morning.

The backups are loaded into a dockerized mysql instance, this docker container binds the datadir to a host volume stored on a filesystem with Copy On Write support.

Once the templates have been loaded the script stops the template database instances.

Every time a user asks for a new database the service performs a copy on write from the template to a new directory, this directory is mounted as a volume for a new mysql docker instance launched for this user. As the operation is performed against a COW filesystem the operation is both fast and space efficient.

Finally the service responds with access data required to use the database.

What you will find here:

TODO

  • Use docker volume API instead of hacking arround with volume bindings
  • Create adapters for postgresql and mongodb
  • Update testsuite, broken after refactoring

Extendibility

MyAAS has been designed with mysql in mind, but the implementation is database agnostic and can be adapted easily to work with any type of database which stores data in disk.

Look for MysqlDatabase adapter to have an idea of how easy is to support new databases, you just need to extend AbstractDatabase and define a few properties.

Support

If you have problems using this service open an issue.

myaas's People

Contributors

hugochinchilla avatar jaumebecks avatar mangeld avatar tpizah avatar

Watchers

 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.