LAMP Developer
LAMP Developer

Reputation: 11

Master Master Replication Issue

I have found two common issues in master2 replication

  1. Handling auto increment:

-- Master1 -- auto_increment_increment = 2 auto_increment_offset = 1

-- Master2 -- auto_increment_increment = 2 auto_increment_offset = 2

These settings should result in an arithmetic progression for the auto-increment columns: - Master1: 1,3,5,7,9,11,13 ... - Master2: 2,4,6,8,10,12,14 ...

  1. Handling unique key : Assume i have two masters. What if two user try to register with same email-id at same time and both goes to different server and therefor email-id get inserted.

How to handle such cases.

Also is there any list of such issues in master2 replication

Upvotes: 1

Views: 105

Answers (1)

Zafar Malik
Zafar Malik

Reputation: 6854

Your point1 handling auto_increment is not an issue as it is handled by master-master replication-

But point2 is a concern as you have to manage your transactions in your application carefully otherwise replication will collapse.

You can check details at below links-

link1

link2

Upvotes: 1

Related Questions