{"id":28548768,"url":"https://github.com/pparshin/go-mysql-tarantool","last_synced_at":"2025-07-02T15:31:04.424Z","repository":{"id":55903010,"uuid":"306676320","full_name":"pparshin/go-mysql-tarantool","owner":"pparshin","description":"MySQL - Tarantool replicator","archived":false,"fork":false,"pushed_at":"2020-12-08T10:25:59.000Z","size":93,"stargazers_count":5,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-10T01:11:34.385Z","etag":null,"topics":["golang","mysql","replication","replicator","tarantool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pparshin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-23T15:29:47.000Z","updated_at":"2025-04-06T09:45:07.000Z","dependencies_parsed_at":"2022-08-15T09:01:08.893Z","dependency_job_id":null,"html_url":"https://github.com/pparshin/go-mysql-tarantool","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pparshin/go-mysql-tarantool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pparshin%2Fgo-mysql-tarantool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pparshin%2Fgo-mysql-tarantool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pparshin%2Fgo-mysql-tarantool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pparshin%2Fgo-mysql-tarantool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pparshin","download_url":"https://codeload.github.com/pparshin/go-mysql-tarantool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pparshin%2Fgo-mysql-tarantool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263165696,"owners_count":23423994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","mysql","replication","replicator","tarantool"],"created_at":"2025-06-10T01:10:40.639Z","updated_at":"2025-07-02T15:31:04.414Z","avatar_url":"https://github.com/pparshin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/pparshin/go-mysql-tarantool?sort=semver\u0026style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pparshin/go-mysql-tarantool/CI?style=for-the-badge)\n![Coverage Status](https://img.shields.io/codecov/c/github/pparshin/go-mysql-tarantool?style=for-the-badge)\n\n\n# MySQL - Tarantool replicator\n\nIt is a service to replicate data from MySQL into Tarantool automatically.\n\nIt uses `mysqldump` to fetch the origin data at first, then syncs data incrementally with binlog.\n\n## Requirements\n\n- MySQL supported version \u003e= 5.7, MariaDB is not supported right now.\n- Tarantool \u003e= 1.10 (other versions are not tested).\n- Binlog format must be set to `ROW`.\n- Binlog row image must be full for MySQL.\n  you may lost some field data if you update PK data in MySQL with minimal or noblob binlog row image\n- `mysqldump` must exist in the same node with mysql-tarantool-replicator. \n  If not, replicator will try to sync binlog only.\n\n### MySQL\n\nCreate or use exist user with replication grants:\n\n```sql\nGRANT PROCESS, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%';\nFLUSH PRIVILEGES;\n```\n\n## Mappings\n\nReplicator can map MySQL tables to one or more Tarantool spaces. \nEach mapping item contains the names of a database and a table, \na list of replicated columns, a space name.\n\nReplicator reads primary keys from MySQL table info and sync them automatically.\nUpdating primary key in MySQL causes two Tarantool requests: delete an old row and insert a new one, because\nit is illegal to update primary key in Tarantool.\n\n### Custom mapping rules for columns\n\nReplicator can cast the value from MySQL to the required type \nif your Tarantool schema does not comply with the MySQL schema.\nFor example, MySQL column stores `bigint(20)` values, but Tarantool\nexpects `unsigned`. \nWithout explicit casting you will get an error, e.g.:\n\u003e Tuple field 1 type does not match one required by operation: expected unsigned\n\nSupported types to cast to:\n* `unsigned`: try to cast any number to unsigned value.\n\nIf MySQL column stores `null` values, you can replace them by another value.\nIt is useful when the space format is defined or you have an index on this field in Tarantool. \n\nCustom column mapping configuration example:\n\n```yaml\n...\n  mappings:\n    - source:\n        schema: 'city'\n        table: 'users'\n        columns:\n          - client_id\n      dest:\n        space: 'users'\n        column:\n          id:\n            cast: 'unsigned'\n          email:\n            on_null: 'my_default_value'\n          client_id: \n            cast: 'unsigned'\n            on_null: 0\n```\n\n## Docker image\n\nImage available at [Docker Hub](https://hub.docker.com/r/pparshin/go-mysql-tarantool).\n\nHow to build:\n\n```bash\ndocker build -t mysql-tarantool-replicator:latest .\n```\n\nHow to use:\n\n```bash\ndocker run -it --rm -v /my/custom/conf.yml:/etc/mysql-tarantool/conf.yml mysql-tarantool-replicator\n```\n\n## Metrics\n\nReplicator exposes several debug endpoints:\n\n* `/metrics` - runtime and app metrics in Prometheus format,\n* `/health` - health check.\n* `/about` - shows app version and build information.\n\nHealth check returns status `503 Service Unavailable` if replicator is not running, dumping \ndata or replication lag greater than `app.health.seconds_behind_master` config value.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpparshin%2Fgo-mysql-tarantool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpparshin%2Fgo-mysql-tarantool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpparshin%2Fgo-mysql-tarantool/lists"}