Re:“We have been experiencing a catastrophic DDoS attack”
by viraptor on Sunday September 04, 2016 @12:32AM
(#12422707)
It's pretty much the same. You almost never want writes on both sides (now in a failover plan anyway), so as long as you have a switch for which side receives the writes, it's simple.
[ Parent
| on HN ]
Re:“We have been experiencing a catastrophic DDoS attack”
by monkeywork on Sunday September 04, 2016 @01:36AM
(#12422895)
Site A, insure any writes use odd numbers in unique field.
Site B, insure any writes use even numbers for unique field.
This avoids conflict.
Re:“We have been experiencing a catastrophic DDoS attack”
by echelon on Sunday September 04, 2016 @02:13AM
(#12423010)
Or allow writes in both datacenters with randomized tokens as keys. If you need datacenter-affinity for certain events, use one of the token bytes to encode the author datacenter. Updates that don't have to land in order can be written in an eventually consistent manner. Write a feed of changes in each datacenter and have the peers consume this update feed. Viola, partition-tolerant master-master with failover.
Re:“We have been experiencing a catastrophic DDoS attack”
by viraptor on Sunday September 04, 2016 @05:17AM
(#12423490)
This is necessary but not sufficient to prevent issues. Sure, it will prevent auto increment key collisions, but unless you're using strict sessions everywhere you can run into other key consistency problems. For example if one master deletes a row while another updates it you'll end up with a missing key and stopped replication on the first one. (depends on the replication mode as well)
Re:“We have been experiencing a catastrophic DDoS attack”
by porker on Sunday September 04, 2016 @10:12AM
(#12424425)
Doesn't this work only for an append-only structure?
If I'm updating existing records, and the MySQL master at Site A gets updated, then goes down before Site B is updated.. I've got an inconsistent setup.
Been thinking about Master-Master MySQL replication recently as we have a system that's duplicated and taken offline each summer (to run a summer camp), and looking for a way to sync changes in it back to the main 'live' MySQL database.