Distributed high concurrency design case of spike system design

Spike system design

【第一版设计】

1. Front-end page level: Anti-duplicate submission control

1) The page spike button is grayed out

2) Prevent duplicate submission of pages

2. Application level

1) Token mechanism, distribute tokens through Redis, and only users who get the token can access the database

2) The same user needs to set a time interval 时间间隔before submitting again

3. DB level

1) Prevent oversold: optimistic database lock

【第二版设计】

0. [Filtering legitimate requests] Perform security verification and interface signature verification on request parameters

1. [Request distribution filtering] Before requesting the back-end interface -> Introduce Nginx for load balancing, and share the request volume

2. [Single machine bottleneck] More requests, beyond the bottleneck of a single Redis processing, Redis cluster

3. [Database bottleneck] The database processing pressure is too large, introduce the message queue MQ, asynchronously process the message request, and then do the database partitioning and table processing

4. [System architecture optimization] Separate independent spike microservices, and use Docker technology k8s to provide automatic expansion and contraction capabilities for burst requests

Reference picture:

        

Guess you like

Origin blog.csdn.net/Coder_Boy_/article/details/111569877