One million level spike logical thinking

Spike logic:
1. call distal spike single interface, which user information, product information spike, spike production and Id, is sent to Mq, then immediately returned to the front end of the spike Id
2. After the front end to get a response, jumping to pay results page, then the query results page a user query spike results (by spike Id), once every few seconds a query, the query results are not displayed are lining up in a rush to buy ........... ..
3. spike spike Mq consumer receives the service message, the use of distributed lock inventory deductions, after the success to the database, but also keep a spike unsuccessful results to the database, so that you can query results can be returned to the front
4. the spike can save the results to redis, userId plus a success status, the query results so that the user can quickly judge whether a successful spike

Guess you like

Origin www.cnblogs.com/yangxiaohui227/p/11332468.html