I've a great dilema here and didn't know how to solve it. I need to replicate a few tables from MySQL DB (slaves) to MySQL DB (master). Take as an example this:
MySQL DB (master)
table1
table2
table3
MySQL DB (slave1)
table1
table2
table3
MySQL DB (slave2)
table1
table2
table3
MySQL DB (master) should replicate content of table1 all days to MySQL DB (slave1, slave2) and MySQL DB (slave1, slave2) should replicate content of table2 and table3 to MySQL DB (master) all days. Tables are identical but data can change between master and slaves. I have a few questions around this:
- Does any know a solution for this? I mean how I can implement this?
- MySQL hosts are not in the same network so how to deal with this side?
- Because tables has the same structure what happens if for example ID column have the same values in master table1 and slave table1? Will be overwritten? Will be added as a new record?
- How to maintain integrity?
- What happens if slaves modify a record that has previously synchronized with master?
MySQL hosts are mostly Windows 7 PC