As I know starting from MySQL v5.7.6 the multi-source replication is possible. So If we can have a slave that can get data from multiple masters. Can we have mesh replication, where each node act as a slave for all other nodes ?

Mesh Replication

If we have 4 nodes (N1, N2, N3, N4)

  • N1 is a slave for N2, N3, N4.
  • N2 is a slave for N1, N3, N4.
  • N3 is a slave for N1, N2, N4.
  • N4 is a slave for N1, N2, N3.

If yes we can do that ? How nodes detect duplicated events in such scenario:

  • A new change in N1 is happened.
  • N1 pushes this change into N2, N3, N4.
  • The new change is received at N2 (and the other nodes).
  • How N2 does't replicate it again ! Otherwise we will have a infinite loop !

enter image description here


1 Answer 1


It's called Galera.

A write to any node is automatically replicated to all other nodes.

Galera is usually deployed in 3-node configuration, but 4 is possible.

It is available from Percona (PXC), MariaDB, or an addon to MySQL.

Please explain why you want that configuration.

And, no, Galera won't get into an infinite loop. Nor will any other multi-master setup -- as long as you set server-id to different values on each Master.

  • I am not asking about Galera.
    – faressoft
    Jul 13, 2018 at 2:46
  • @faressoft - OK, you could simulate some of what Galera does. But the hard part would be repairing the setup if any node crashes.
    – Rick James
    Jul 13, 2018 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.