当前位置:网站首页>设计电商秒杀系统
设计电商秒杀系统
2022-07-03 20:22:00 【InfoQ】
一、背景
技术
- 技术团队 Java 技术为主
- 已落地微服务
- 目前单机房
- 有 APP 跟微信小程序,要求仅 APP 用户才能参与秒杀
业务
- 在销售商品 <=10 个品类 *20 个商品
- 本次秒杀 2 个商品(1000 个充电宝、10 台 iphone12)
- 正常日活大约 100w 用户
- 目前只有单机房
- 老板需要万无一失
二、业务分析
三、设计的思路
- 做好隔离:包括秒杀服务的隔离、中间件的隔离。单独部署服务集群,防止拖垮其他服务。
- 多层限流:保证到达 DB 层能在可控的流量。
- 尽量缓存:把商品提前预热到缓存,包括库存的数据。
- 高可用设计:包括限流、排队、降级、熔断。

存储架构设计


六、计算架构设计
6.1、负载均衡设计

6.2、缓存设计

七、高可用设计
7.1、限流设计

- 1、请求端的限流:发起请求的时候限流,被限流的请求实际上没有到后端服务器
- 2、接入端的限流:接到业务请求的时候进行限流,避免请求进到实际的业务处理流程
- 3、单个服务自我保护,如果请求太多,可以舍弃新的请求
7.2、排队设计

- 1、排队模块。使用 Kafka 消息队列,将请求以先进先出的方式保存下来,队列大小可以比秒杀商品多一些。
- 2、调度模块。根据秒杀服务处理能力检测,有能力处理,将队列的消息下方到秒杀服务中去。
- 3、其他服务。真正的业务处理模块,如下单、完成交易。
7.3、降级设计

7.4、熔断设计

边栏推荐
- 47. Process lock & process pool & Collaboration
- In 2021, the global general crop protection revenue was about $52750 million, and it is expected to reach $64730 million in 2028
- Camera calibration (I): robot hand eye calibration
- Plan for the first half of 2022 -- pass the PMP Exam
- 浅议.NET遗留应用改造
- [effective Objective-C] - block and grand central distribution
- Promethus
- Micro service knowledge sorting - cache technology
- It is discussed that the success of Vit lies not in attention. Shiftvit uses the precision of swing transformer to outperform the speed of RESNET
- FAQs for datawhale learning!
猜你喜欢

Test panghu was teaching you how to use the technical code to flirt with girls online on Valentine's Day 520

Node MySQL serialize cannot rollback transactions

2.5 conversion of different data types (2)

Recommendation of books related to strong foundation program mathematics

19、 MySQL -- SQL statements and queries

Do you really know how old you are?

Vscode reports an error according to the go plug-in go get connectex: a connection attempt failed because the connected party did not pro

Point cloud data denoising

Change deepin to Alibaba image source

FAQs for datawhale learning!
随机推荐
Operate BOM objects (key)
[Yu Yue education] basic reference materials of manufacturing technology of Shanghai Jiaotong University
Popularize the basics of IP routing
How to do Taobao full screen rotation code? Taobao rotation tmall full screen rotation code
The global industrial design revenue in 2021 was about $44360 million, and it is expected to reach $62720 million in 2028. From 2022 to 2028, the CAGR was 5.5%
[effective Objective-C] - block and grand central distribution
MySQL dump - exclude some table data - MySQL dump - exclude some table data
Plan for the first half of 2022 -- pass the PMP Exam
2.4 conversion of different data types
Initialization and instantiation
Global and Chinese market of speed limiter 2022-2028: Research Report on technology, participants, trends, market size and share
Exercises of function recursion
11-grom-v2-04-advanced query
In 2021, the global revenue of syphilis rapid detection kits was about US $608.1 million, and it is expected to reach US $712.9 million in 2028
Global and Chinese market of full authority digital engine control (FADEC) 2022-2028: Research Report on technology, participants, trends, market size and share
An old programmer gave it to college students
MySQL master-slave synchronization principle
Global and Chinese market of charity software 2022-2028: Research Report on technology, participants, trends, market size and share
Strange way of expressing integers (expanding Chinese remainder theorem)
App compliance