当前位置:网站首页>模块九 - 设计电商秒杀系统
模块九 - 设计电商秒杀系统
2022-08-10 10:59:00 【InfoQ】
要求

业务性能分析
业务场景
- 待秒杀商品提前加载入 Redis 缓存
- 秒杀前10分钟用户集中登录 App
- 秒杀前用户频繁刷新对应商品页
- 秒杀请求通常集中在活动开始后10秒内
- 秒杀成功的订单在5分钟内完成支付
性能分析
- 正常日活100万,假设由于618活动预热,当天日活数翻翻达到200万,其中 30% (60万)会参与秒杀活动。
- 秒杀前10分钟登录请求 60万,QPS = 600,000 / 10 / 60 = 1000
- 秒杀请求有3种返回结果:成功,售罄,失败。
- 成功和售罄的情况下用户均无法再次参与秒杀。
- 失败是由于高并发情况下系统未成功处理请求,用户可能会重新点击秒杀重试。假设平均每个用户重试两次。
- 由此估算秒杀 TPS = 600,000 * 2 / 10 = 120,000
存储架构
- 秒杀活动主要由 Redis 集群来处理,包括商品预览,库存实时刷新等;
- MySQL 用于数据持久化。

负载均衡
- 由于公司目前还在创业阶段,故不考虑F5。采用三级负载均衡架构

缓存设计

高可用架构
- 系统正常日活在百万级别,暂不考虑异地多活
- 老板要求万无一失,采用同城双中心

边栏推荐
猜你喜欢
![[Brave food, not afraid of the linked list of brushing questions] Merging of ordered linked lists](/img/06/9d49fc99ab684f03740deb2abc38e2.png)
[Brave food, not afraid of the linked list of brushing questions] Merging of ordered linked lists

从脚本到剪辑,影像大师亲授的后期制作秘籍

Gold, nine, silver and ten job-hopping seasons: technical interview questions and answers on Alibaba, Baidu, JD.com, and Meituan

使用哈工大LTP测试分词并且增加自定义字典

第3章-线性方程组(3)

为什么Redis很快

From the product dimension, why can't we fully trust Layer2?

mysql appears: ERROR 1524 (HY000): Plugin '123' is not loaded

Dry goods!ASSANet: Making PointNet++ faster and stronger

C#实战:基于ItextSharp技术标签生成小工具
随机推荐
OneFlow源码解析:算子指令在虚拟机中的执行
[Brave food, not afraid to write the linked list] The problem of the penultimate node of the linked list
Open Office XML 格式里如何描述多段具有不同字体设置的段落
中小规模网站架构
这些年我开源的几个小项目
LeetCode_628_三个数的最大乘积
AUTOCAD - reducing spline curve control points, the advanced CAD practice (3)
实现内网穿透的最佳解决方案(无实名认证,完全免费)
mysql5.7 installation and deployment - yum installation
是什么影响了MySQL性能?
Codeforces 862 C. Mahmoud and Ehab and the xor (技巧)
从源码角度分析UUID的实现原理
Interviewer: Dao, in Service, the Controller, Util, divided into the Model?
3 injured in 'electrical accident' at Google data center
老板加薪!看我做的WPF Loading!!!
短视频软件开发——平台同质化如何破局
Kyligence 通过 SOC 2 Type II 审计,以可信赖的企业级产品服务全球客户
阻塞 非阻塞 poll机制 异步
今天面了个腾讯拿38K出来的大佬,让我见识到了基础的天花板
js对象转FormData对象(一般用于上传)