0
votes

I have a setup where the same Database structure is replicated across 4 servers. but the problem is, that the data isnt the same between the servers, so i cant just replicate them. as far as i know, replication master/slave should have same data and same structure, so i think its not my case.

my case : All Database have a table called Transaction with column UserID

  • Slave A have 2 rows, (12,15)
  • Slave B have 3 rows, (1,4)
  • Slave C have 1 Row (8)
  • Slave D have 7 Rows ( 2,3,5,6,7,9,10 )

now of course the Master DB needs to include all the rows.

  • Master have 13 Rows ( 12,15,1,4,8,2,3,5,6,7,9,10 ) ( after the slaves sync their data to Master )

after I sync, the rows inside the Master DB should be replicated to all the "slaves" ...

This scenario will happen every day. new rows will be inserted into the slaves DB.... then all the slaves should report to the Master, and finally, the master will push all the data back to the slaves again.

so my questions are:

  • is it a master/slave concept?
  • do I need to have a different structure?
  • if yes, how can i make Mysql do it for me ?

I searched for a question similar but i couldn't find one. if you can refer me to a question already asked, it would be awesome

thanks

1
You are violating the fundamental concept of replication. In replication master is for write and slaves are read only. So when write happens in master the binlog will have the details and will get replicated to slave. - Abhik Chakraborty
mm i see... so its not master/slave. what we call this structure? - GeniusCD
This maybe of interest - I haven't used it but have seen references to it for multi-master syncing. galeracluster.com - PaulF
after reading i think this link should help dba.stackexchange.com/questions/9424/… - GeniusCD

1 Answers

0
votes

Your requirement can be fulfill by implementing multi master mysql server instead of Master-slave replication. In master-slave replication: traffic flows from master to slave only (only in one direction).