Profile:
In the project development, often have such a scenario, the database to add, modify, delete the application of the operation directly connected to the master library, only the database query application, will first establish a central cache, such as Redis or memcache, if the cache is not hit, Then directly access the slave library. The following describes what to do if a master-slave delay occurs when the central cache is refreshed. That is, when the application System-a database to the master library, System-b application in the reading slave library, the master Library of data is not synchronized to the slave library, if this time to refresh the cache, the old data will be directly to the cache.
Please see my csdn blog for more information:
Real-time Refresh caching-some design scenarios for handling MySQL master-slave delay
Real-time Refresh caching-some design scenarios for handling MySQL master-slave delay