1. Optimize sql and indexes;
2. Add cache, memcached, redis;
3. Master-slave replication, master-master replication, read-write separation, can be done at the application layer, with high efficiency, and third-party tools can also be used, third-party tools recommend 360
Atlas
, others are either inefficient or unmaintained;
Fourth, segmentation, mysql comes with its own partition,
5. Vertical segmentation, dividing a large system into multiple small systems (distributed systems);
6. Horizontal segmentation, select the shadding key, and locate the data in the corresponding table instead of the full table scan. In order to make a good query, the table structure needs to be changed, some redundancy is required, and the application has to be changed. Try to use the shadding key in SQL;
Introduction to Atlas:
http://www.oschina.net/p/atlas/
Reference blog:
http://www.zhihu.com/question/19719997