Skip to content

luiscoms/multi-databases-py

Repository files navigation

Multi Databases

This solution has a CPF query service that makes available the personal data stored in MySQL.
Each call in this service sends an event to an event queue on RabbitMQ.
A worker processes these events and stores them in MongoDB and updates the last record in Elasticsearch.

Given 3 databases

MySQL

It stores accounts data.

MongoDB

It stores events related data.

Elasticsearch

It stores the latest event associated to an account.

Running

  • Create .env file
MYSQL_ROOT_PASSWORD=example
RABBITMQ_DEFAULT_PASS=example
COMPOSE_FILE=docker-compose.yml:whois-api/nested-docker-compose.yml
  • Run docker-compose
$ docker-compose up
  • Run database migration
$ virtualenv venv
...

$ source venv/bin/activate

(venv) $ pip install -r requirements.txt
...

(venv) $ yoyo apply -p
Password for mysql://root@localhost/secure-database:
... applied

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages