Database replication questions
Posted on 2009-12-19
Hi guys, right now I am reading the documentation of some FB replication engines. The type of the replications is two way with logs. There are some things I don't fully understand.
1. It is sertain, that the PKs created by each slave must be unique. For example the first will create PKs starting from "1", the second starts with "1 000 000 000" etc. Wht I don't understand is that some replication eingins like FiBRE, say you need to have unique PK for all the tables. For exmple on table "customers" you create a record with pk = 1 and then on the table "clients" the first row must be pk = 2. Is this really necessary? I think its not. Tell me pls.
2. The second thing that can't get out of my head is the so called "Update Conflict". For examle the slave 1 creates a record with values 1 2 3, and replicates them to the server. Slave 2 synchronises its DB and changes the field 2 to 5 and replicates. then the first slave changes the value and replicates. And BOOM, here comes the problem, cos if slave 1 has query of "update client set name = 'Peter' where name = 'Not Peter'" but the second slave has changed the value of "Not Peter" to "John". When the first one replicates the DB this update statement will change nothing. Pls give me a solution to this problem.