Mysql – the maximum latency / distance thesql replication can tolerate without having errors or wrong data

master-slave-replicationMySQLreplication

I have two machines in a master – slave replication. I want to know if they are in two seperate places e.g. London, England and Tokyo, Japan are there going to be any latency issues.

What exactly is the maximum latency (if possible measured using distance) that mysql replication can tolerate before an error happens or before the two databases are different enough that the second one can give wrong data or any other error?

Best Answer

You should consider what distance does to any DB connection.

I have some posts from myself and others on this subject

Another member of this StackExchange, Aaron Brown, wrote a nice blog about measuring latency even with semisynchronous replication. Although his blog is 8 years old and technology has improved since, you should write the same test Aaron did to test the latency yourself. After all, London to Tokyo is intercontinental where US West to US East is within the same country. Latency should be expected, but only your testing will reveal how tolerable it will be.

Please review them and see if you can setup semisynchronous replication.

CAVEAT : if you are using Amazon RDS or Google GCP, you are at their mercy when it comes to latency.