MySQL Forums
Forum List  »  Newbie

Re: Clustered primary key question
Posted by: Doron Grinstein
Date: August 23, 2015 03:33AM

If I understand your suggestion correctly, you're saying to use an auto-incrementing INT as the primary key and a second field as a GUID. With an Index on the second field.

This approach does not work for multi master scenarios. I want the system to survive network partitions. Assuming I have 3 db hosts, a, b, c: I want users close to a to insert into a, those close to b to insert into b and those close to c to insert into c. Suppose users close to a can reach a, but a cannot reach b. Users of b can still reach b and insert there. When connectivity between a and b is re-established, replication will fail if an id in a is already taken by an insertion that took place in b.

Unless I misunderstood what you meant in your post or I misunderstand how replication works in MySql (each replica can have different primary key?) then your proposed solution does not seem to help.

I do appreciate your continued interest in this topic and honestly hope that there is a viable approach to using GUIDs as primary keys in MySql.

Options: ReplyQuote


Subject
Written By
Posted
Re: Clustered primary key question
August 23, 2015 03:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.