Architecture direction:
MySQL + redis
MySQL Read
Redis Write
involves MySQL + redis master-slave replication using triggers and queued tasks
1, when the data changes, priority to the data into Redis from the table, and in the Redis message queue to add table change tasks, using a timer to gradually trigger into MySQL
2, data Backup, Redis and MySQL separate from backup
3, related to the transaction, the timeliness of high demand for direct use of MySQL
4, related to the new user registration or payment module, to see the specific analysis of requirements, such as directly inserted into MySQL, 3 seconds after the jump, then in the background processing cache update transactions
Layered:
1. Controller layer: Assemble or separate multiple ports directly for the data required by each module
2, the event layer: Separate the events of each module, so that the controller can be individually corresponding to different end, mobile phone, APP, Web page to do different processing
3, Logic Layer: for multi-table operation, and data legitimacy filtering more cumbersome operations, as a data layer to supplement
4. Data layer: Operation database
5, Cache layer: As a data layer read and write data of a supplement
Summary of experience (personal note)