Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/lynxline/momyre

MOngo to MYsql simple REplicator. The package is the missing link to run replication process from the mongo cluster to the mysql databse
https://github.com/lynxline/momyre

database databases docker mariadb mariadb-database mariadb-replication mongo mongo-mariadb mongo-mysql mongo-replication mongodb mysql mysql-database replica replica-set replicaset replicate replication replication-package replicator

Last synced: 3 days ago
JSON representation

MOngo to MYsql simple REplicator. The package is the missing link to run replication process from the mongo cluster to the mysql databse

Awesome Lists containing this project

README

        

# MOMYRE

What is it?

# MOngo to MYsql simple REplicator

## Intro

The repository is missing link to run replication process from the mongo cluster to the mysql databse

That way the data from mongo databse can be used with
any compliant application for making sql queries over the data replicated from mongo databse.

Also note Momyre is a work in progress and currently has some limitations.

The docker image is compact (~20MB) alpine-based, can run on Linux / Mac / Windows with
appropriate setup of Mongo custer and MySQL databse

## Disclaimer

I am not a database expert and I don't know whether Momyre is actually perfectly safe for
replication. I wouldn't recommend using for anything highly sensitive until you
proof it fill your needs with appropriate restrictions.

## Download the software

PC: linux/amd64:
```bash
docker pull yshurik/momyre:latest
```

## Run stages

First momyre gets list of exisiting tables and compare with list of mappings.

If there are extra tables it will create them.

Also momyre gets list of columns in tables and compare with list of mappings.

If there are extra columns it will create them.

If some table/column is not present in mappings, momyre wil want to remove it.

To have it removed the momyre needs to run with ```--force``` options

## Examples of mapping data

``` yaml
emails:
from: "varchar(100)"
rcpt: "varchar(100)"
subj: "varchar(100)"
body: "blob"
```

Can also map arrays into blobs as json:

``` yaml
emails:
from: "varchar(100)"
rcpts: "blob"
subj: "varchar(100)"
body: "blob"
```
In last case if you have an mongo object with multiple recipients like:
``` json
{
"from" : "[email protected]",
"rcpts" : [
"[email protected]",
"[email protected]"
],
"subj" : "test",
"body" : "test"
}
```
Then mysql/mariadb column "rcpts" will have blob with json
``` json
[ "[email protected]", "[email protected]" ]
```

## Running momyre docker container

The docker container can be started with appropriate config mappings.

```bash
docker run -v ./momyre.yml:/momyre/momyre.yml -d --name momyre yshurik/momyre:latest
```