4 ms·
Primary key conflicts are still a thing. Especially problematic where you're either not using auto_incrementing PKs, and/or you try to switch writes from one ma
by jjirsa 9y ago
Primary key conflicts are still a thing. Especially problematic where you're either not using auto_incrementing PKs, and/or you try to switch writes from one master to the other and app has to be aware of the switch.
- stephenr 9y agoNot using auto incrementing keys is surely a rarity with MySQL projects. Even before galera was a thing regular MySQL replication could use auto_increment_(increment|offset) to make each server generate unique id's.
- jjirsa 9y agoThere exists a LOT of data models that don’t use auto incrementinf primary keys. Rarity or not, it’s a real use case and a real problem for master/master replication Also, even if you do use auto increment with offsets for each server, you’ll have to know how many servers you’ll eventually have, or waste offsets and eventually risk outrunning your data types
- stephenr 9y agoNon auto keys will already need some way to ensure uniqueness that will involve the application expecting conflicts. For those that do use auto inc, galera will manage the offset/increment value based on cluster size automatically.