How to avoid replication lag in case all writes on master and reads on replica?
3
votes
2
answers
6210
views
I have stuck with the replication lag problem. I am trying to refactor my DB infrastructure.
The first step was read-write split. I used ProxySQL то implement it. Now I have masterDb where all INSERT and UPDATES executing and 2 replicas where I route all SELECT.
But the main problem I faced with, replication lag. Because usually when you change something in DB you immediately read data and expect to have new data in the query result, but with replication lag, I receive outdated data. After googling I found this article https://www.percona.com/blog/2018/11/29/mysql-high-availability-stale-reads-and-how-to-fix-them/ and according to this info the best option in 2018 was "ProxySQL 2.0 GTID consistent reads"
Any updates from 2018? Maybe you guys know a better solution? Please share!
Asked by Volodymyr Bilovus
(133 rep)
Jan 31, 2022, 10:55 AM
Last activity: Jan 31, 2022, 05:46 PM
Last activity: Jan 31, 2022, 05:46 PM