MySQL Study Notes (6) scalability design-memcached1. as a tool for improving system performance
The following figure shows a brief diagram of using memchched as the cache service layer:
It can be seen that all data needs to be inserted, updated, and deleted to the Master. If the master is updated or deleted, it will be deleted from memcached to maintain data consistency. When reading data, read data from memcached first. If the data cannot be read, read data from slave.
In fact, this method has little to do with Mysql itself, and can be implemented through applications.
2. Integrate with MySQL into the data service layer
We usually have two ways to implement this architecture:
1. Use memcached's memory capacity as MySQL's second-level cache to increase MySQL's cache capacity;
It can be implemented through an open-source project waffle Grid
2. MySQL communicates with memcached through udfs, and the client can directly interact with memcached.
In this way, memcached maintenance is handed over to the master