From the perspective of MySQL performance optimization in the past few days, the basic idea is to divide and divide . . .
1. Split reading, use the cache to share the pressure of reading the table;
2, read-write separation, master-slave separation, write master library, read slave library, read cache;
3. Sub-library: According to the vertical division of functions, a multi-functional library is divided into many single-function libraries; according to the horizontal division of data (sharding), a single-function large library is divided into many single-function small libraries; (for example, according to the main key to divide )
4. Sub-table: Basically, it is divided according to the level, and a large table is divided into many parallel small tables;
5. Layering: Add a data access layer (DAO?) between the API and the database, which is transparent to the outside world;