Optimization of three points:
1.Redis pre-cut to reduce inventory database access
2 memory access flag reduced Redis
3. request to enqueue the buffer, asynchronous orders, enhance the user experience
Ideas: reduce database access
1. system initialization, the number of goods inventory to load Redis
2. receipt of the request, Redis pre-cut inventory, inventory shortage, direct return, otherwise go to 3
3. Request into the team, immediately return to the queue
4. Request the team, generate orders, reducing inventory
5. client polling, if successful spike
Reproduced in: https: //www.jianshu.com/p/374eef1b05c7