https://github.com/luiscoms/multi-databases-py
https://github.com/luiscoms/multi-databases-py
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/luiscoms/multi-databases-py
- Owner: luiscoms
- Created: 2018-12-17T03:30:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-17T17:13:25.000Z (about 7 years ago)
- Last Synced: 2025-02-02T08:44:45.208Z (11 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)
It stores accounts data.
It stores events related data.
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