Is there an example of anyone using Debezium MongoDB source connector and having that populate a MySQL format database as a Sink.
We are having issues with wrapping our heads around using Mongodb cdc statements for updates and cleanly applying them to a sink database that is MySQL.
Example Source Collection snippet
UserProfile{
address:{ street: "1st Street", city:"Chicago",state:"IL"}
visits: 50
......
}
Example Sink Table snippet
TABLE: USER_PROFILE
COLUMNS:
....
address_street
address_city
address_state
visits
We can handle initialsync and op=c just fine as it gives us the whole record in the "after" with nested fields and we can map to table. Where we run into issues is on the updates and parsing and mapping those correctly with the various $set, $unset, $incr statements that can be in the "patch" section
examples statements showing up in "patch" that we have to map (not all inclusive operations)
"patch" : {"$set" : {"address.street" : "2nd Street"}} - path to field properties type format
"patch" : {"$set" : {"address" : {"street":"2nd Street"}} - path to field object notation
"patch": {"$set" : {"address" : {"street":"2nd Street"}, "$inc": {"visits":10}} - mutiple statements
We are running into having to account for all Mongo DML statements to get to field mapping through a Kafka Streaming consumer listening to Mongo Source CDC (Debezium) output.
Is there a better way to attack this?
Thanks,
Kirk