Bidirectional replication

333 views
Skip to first unread message

Ali Batuhan KARAÇOBAN

unread,
Jan 11, 2022, 11:34:05 AM1/11/22
to debezium
Hi,

Can we make a bidirectional replication with debezium?

Gunnar Morling

unread,
Jan 11, 2022, 12:02:35 PM1/11/22
to debezium
Hi,

Yes, you can, but it will require some consideration.

First of all, Debezium currently is a set of *source* connectors for Kafka connect, i.e. you'll need to add a sink connector which writes the change event data into a target database. Work in the Debezium community has started to create a JDBC sink connector as part of the Debezium project [1], but we don't have an ETA yet for when that will be available.

Second, you'll need to make sure to not propagate the same data change forth and back in an infinite loop. One way of doing so could for instance be an SMT which you apply to both sources and which adds a Kafka Connect header property representing the "origin" of a given change. In your sink connector, you'd then add that origin as an additional column to your data as you update it. The source connector on that side would then have to be set up (e.g. again using an SMT) to ignore all the changes which originate from replication, as opposed to actual data changes e.g. done by a business application.

Out of curiosity, what's the reasoning / use case for setting up a bi-directional replication stream?

Hth,

--Gunnar

Ali Batuhan KARAÇOBAN

unread,
Jan 14, 2022, 1:59:40 AM1/14/22
to debe...@googlegroups.com
I have answered your questions but I don't understand did you received it, Mr Gunnar

--
You received this message because you are subscribed to a topic in the Google Groups "debezium" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/debezium/YS22DAgFXSc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/74fb94bb-0d6b-416d-b1ed-2b3ea70e70bfn%40googlegroups.com.

Gunnar Morling

unread,
Jan 14, 2022, 12:22:02 PM1/14/22
to debezium
There's no reply here. Can you please make sure to reply to the mailing list? Thx!

--Gunnar
Reply all
Reply to author
Forward
0 new messages