Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-5158

Postresql | use Debezium for master-master replication

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Duplicate
    • Icon: Optional Optional
    • None
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      I need to engineer a rudimental primary-primary replication system for 2 postgresql instances. 

      I have manage to create a system composed of 4 kafka connectors (2 debezium sources and 2 jdbc sinks) that can achieve what i am looking for in a manual fashion. It works like the following:

      • CDC connectors are always on
      • only on Sink connector is active at all times - so effectively this is a maste - – slave replication always in one direction
      • when sync is required in the other direction than user triggers a sync that stops the current active sink connector and starts the other one till sync is complete, than rolls it back to the initial setup

      I like this setup because it is quite straigth forward and conflict resolution is handled with the "last-update-wins" logic, which works well in my case.

      Howver, i am now looking for a more automated way to achieve the sync, without manually have to trigger it.

      If i switch on both sink connectors, then i end up with an infinite write-write loop so my questions are:

      1. is there an official way to achieve this by setting the proper configuration in the debezium connector?
      2. if not --> is it possible to compare changes before/after and discard the ones that are the same, in a way that the infinite loop is prevented?

      I have tried researching on the official doc but i could find nothing that tells me "No this cannot be done, dont waste your time" nor "This can be done like this ... but we dont recommend it"...

      any support here?

              Unassigned Unassigned
              dberardo-com john smith (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: