An open API service indexing awesome lists of open source software.

https://github.com/luiscoms/multi-databases-py


https://github.com/luiscoms/multi-databases-py

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

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

* **Very sensible database** - [MySQL](#mysql)
* **Light sensible database** - [MongoDB](#mongodb)
* **Fast database** - [Elasticsearch](#elasticsearch)

## 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

```bash
MYSQL_ROOT_PASSWORD=example
RABBITMQ_DEFAULT_PASS=example
COMPOSE_FILE=docker-compose.yml:whois-api/nested-docker-compose.yml
```

* Run docker-compose

```bash
$ docker-compose up
```

* Run database migration

```bash
$ virtualenv venv
...

$ source venv/bin/activate

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

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

* Call [whois-api](https://github.com/luiscoms/whois-api.git) endpoints