universeasteroid
universeasteroid

Reputation: 11

Databases bidirectional synchronization

I would like to synchronize two databases bidirectionally, i.e. from old database to new and from new to old. I can use Debezium to achieve this goal. But what are my options to avoid infinite loops, i.e. situation when insert to old database triggers insert to new database and this one triggers insert to old database and so on?

I know I can enrich both old and new database with additional columns that store some synchronization GUID. But is there any way to avoid modifying old database that would still prevent infinite loops?

My scenario is such that there will be two databases, old and new - and also two sets of applications, old applications writing to old database and new applications writing to new database. Gradually, old applications will be migrated to new applications and new schema so that ultimately old database and applications can be abandoned.

So far I have configured Debezium to watch database changes in both databases and small application that listens to the events created by Debezium and saves them to proper database. And now I need to avoid infinite loops.

Upvotes: 0

Views: 95

Answers (0)

Related Questions