We need to sync a users
table on one database instance (MySQL) to a users
table on another database instance (Aurora/MySQL 8) in real time by using CDC
(change data capture).
We use multitenancy, so we have a ton of schemas (databases) on the source like schema_1
, schema_2
, schema_3
, etc. Each of these schemas has it's own users
table.
I want these users tables synchronized in real time to the target, but only if the schema and users
table already exists on the target database. I do not want to create new schemas on the target.
One reason why I don't want these schemas and tables to be created is that the users
table on the source has a bunch of columns that I do not need on the target. Another reason is that this would complicate database migrations (schema migrations through code).
Is there any way to achieve this?
I have it set to:
Option | Value |
---|---|
Migration Type | Replicate data changes only |
Table preperation mode | Do nothing |
The table mappings are as follows:
{
"rules": [
{
"rule-type": "transformation",
"rule-id": "891714557",
"rule-name": "891714557",
"rule-target": "schema",
"object-locator": {
"schema-name": "dev1_schema_%"
},
"rule-action": "add-prefix",
"value": "aurora-db_",
"old-value": null
},
{
"rule-type": "selection",
"rule-id": "891590357",
"rule-name": "891590357",
"object-locator": {
"schema-name": "dev1_schema_%",
"table-name": "users"
},
"rule-action": "include",
"filters": []
}
]
}