当前位置:网站首页>设计电商秒杀系统
设计电商秒杀系统
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、熔断设计

边栏推荐
- 19、 MySQL -- SQL statements and queries
- Initialization and instantiation
- Global and Chinese market of speed limiter 2022-2028: Research Report on technology, participants, trends, market size and share
- Make a simple text logo with DW
- 6006. Take out the minimum number of magic beans
- 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%
- MySQL master-slave synchronization principle
- Exercises of function recursion
- 2.4 conversion of different data types
- 浅议.NET遗留应用改造
猜你喜欢

Haven't expressed the artifact yet? Valentine's Day is coming. Please send her a special gift~

Task of gradle learning

An old programmer gave it to college students

MDM mass data synchronization test verification

2.5 conversion of different data types (2)

Reinforcement learning - learning notes 1 | basic concepts

18、 MySQL -- index

String and+

From the behind the scenes arena of the ice and snow event, see how digital builders can ensure large-scale events

The 29th day of force deduction (DP topic)
随机推荐
Sparse matrix (triple) creation, transpose, traversal, addition, subtraction, multiplication. C implementation
Micro service knowledge sorting - asynchronous communication technology
Cap and base theory
2.5 conversion of different data types (2)
Global and Chinese market of liquid antifreeze 2022-2028: Research Report on technology, participants, trends, market size and share
Qtablewidget control of QT
Producer consumer mode (multithreading, use of shared resources)
Derivation of decision tree theory
Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system
Global and Chinese market of charity software 2022-2028: Research Report on technology, participants, trends, market size and share
Wireless network (preprocessing + concurrent search)
Blue Bridge Cup: the fourth preliminary - "simulated intelligent irrigation system"
44. Concurrent programming theory
Microservice knowledge sorting - search technology and automatic deployment technology
[Tang Laoshi] C -- encapsulation: member variables and access modifiers
Teach you how to quickly recover data by deleting recycle bin files by mistake
How to do Taobao full screen rotation code? Taobao rotation tmall full screen rotation code
Fingerprint password lock based on Hal Library
Global and Chinese market of micro positioning technology 2022-2028: Research Report on technology, participants, trends, market size and share
2166. Design bit set