当前位置:网站首页>毕业设计:设计秒杀电商系统
毕业设计:设计秒杀电商系统
2022-07-04 03:50:00 【InfoQ】
1. 业务基本场景

- 系统(
APP和微信小程序)首页展示秒杀活动,非秒杀时间段秒杀按钮灰显,用户即使不注册登录也是可以浏览商品列表、商品详情的;
- 微信小程序只能看秒杀活动,但是不能参与秒杀,仅能通过
APP客户端参与秒杀;
- 秒杀一般是定时上架,用户可以看到该商品,但是无法点击“立即购买”的按钮,秒杀开始前用户会快速刷新商品页面,访问量很大,在秒杀开始的时候抢先进入下单页面;
- 此次秒杀限量限价不限时,尽可能的为商城引流;而秒杀开始前,商城需要有一系列的活动预热;用户必须先注册登录才可以参与秒杀;
- 秒杀时,只有用户提交的第一个订单发送给网站的订单子系统;
- 每个用户要确保只能秒杀一件商品,只有第一个提交的订单发送给网站的订单子系统;
- 秒杀一般是定时上架,且不能出现“超卖”的问题;
- 秒杀活动是一种营销手段,不能影响商城的日常应用。
2. 存储架构设计
2.1 存储性能估算
2.1.1 注册登录
2.1.2 商品信息
- 存储的商品信息共有
10个品类 * 最多的20个 = 200条数据
- 参与秒杀的用户会快速刷新商品页面,假设每个用户刷新 5 次,则商品信息的请求次数是 400 万*5=2000 万。秒杀的用户快速刷新商品页面主要集中在活动开始前的1小时,则这段时间查询商品信息的
QPS:400W * 5 / (60 * 60) = 5555
2.1.3 秒杀
2.1.4 订单
TPS = 400w/60/60 = 11112.2 存储架构设计

MySQL数据存储500万用户信息和400万用户登录信息
MySQL数据库维护200条商品信息的关系数据库
MySQL数据库存储400W条数据
Redis缓存数据库存储商品的请求信息2000万,订单请求次数400万
3. 计算架构设计
3.1 计算性能评估
3.1.1 注册
3.1.2 登录
3.1.3 商品信息
400 万*10/60*60 = 111113.1.4 秒杀
3.1.5 订单
- 秒杀有效订单 1010,假设这些订单都是在 5S 内生成,则生成秒杀订单 TPS = 1010/5 = 202。
- 按照之前的假设,400W 用户当天平均有 1 条订单且集中在秒杀的 1 小时内,则生成订单的 TPS = 400w/60/60 = 1111;
- 存储的订单数据是 400W 条记录,当天用户平均查询订单 2 次,查询订单请求量是 800W;假设查询时间集中在秒杀后 2 小时,查询订单 TPS = 800W/60/60/2 = 1111。
3.2 计算架构之负载均衡设计

3.2.1 业务特性分析
3.2.2 架构设计
3.3 计算架构之缓存架构设计

3.3.1 下载APP
3.3.2 业务特性分析
3.3.3 架构设计
4. 高可用架构设计
- 秒杀活动非常态,是一种营销手段,持续时间短,但是会产生比平时大数十倍的页面访问流量和下单流量,如果将秒杀活动和商城的普通应用部署在一起,可能会对日常业务造成冲击,为了提高可用性,可以将秒杀系统独立部署,甚至使用独立域名,使其完全隔离。
- 由于秒杀请求的 TPS 非常大,可以使用排队架构,收到请求后并不立即处理,而是将请求放入队列,系统根据能力异步处理。
4.1 秒杀排队架构

4.1.1 业务特性分析
4.1.2 架构设计
5. 可扩展架构设计
6. 演进
边栏推荐
- [Huawei cloud IOT] reading notes, "Internet of things: core technology and security of the Internet of things", Chapter 3 (I)
- Getting started with the go language is simple: go implements the Caesar password
- Zlmediakit compilation and webrtc push-pull flow testing
- The three-year revenue is 3.531 billion, and this Jiangxi old watch is going to IPO
- 【webrtc】m98 ninja 构建和编译指令
- '2'>' 10'==true? How does JS perform implicit type conversion?
- 选择排序与冒泡排序模板
- Support the first triggered go ticker
- Activiti7 task service - process variables (setvariable and setvariablelocal)
- Illustrated network: what is the hot backup router protocol HSRP?
猜你喜欢

logistic regression

I Build a simple microservice project

三菱M70宏变量读取三菱M80公共变量采集三菱CNC变量读取采集三菱CNC远程刀补三菱机床在线刀补三菱数控在线测量

SQL语句加强练习(MySQL8.0为例)

渗透实战-guest账户-mimikatz-向日葵-sql提权-离线解密

Audio and video technology development weekly | 232

Third party login initial version

Es network layer

EV6 helps the product matrix, and Kia is making efforts in the high-end market. The global sales target in 2022 is 3.15 million?

The difference between bagging and boosting in machine learning
随机推荐
SQL statement strengthening exercise (MySQL 8.0 as an example)
Smart subway | cloud computing injects wisdom into urban subway transportation
Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)
Apple submitted the new MAC model to the regulatory database before the spring conference
【华为云IoT】读书笔记之《万物互联:物联网核心技术与安全》第3章(上)
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
Objective-C member variable permissions
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
Brief explanation of depth first search (with basic questions)
Katalon框架测试web(二十六)自动发邮件
【罗技】m720
Pytest multi process / multi thread execution test case
Huawei cloud Kunpeng engineer training (Guangxi University)
选择排序与冒泡排序模板
SDP中的SPA
1289_ Implementation analysis of vtask suspend() interface in FreeRTOS
Illustrated network: what is the hot backup router protocol HSRP?
The three-year revenue is 3.531 billion, and this Jiangxi old watch is going to IPO
JDBC 进阶
The difference between bagging and boosting in machine learning