当前位置:网站首页>毕业设计:设计秒杀电商系统
毕业设计:设计秒杀电商系统
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. 演进
边栏推荐
- Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
- "Implement both software and hardware" to help build a new cloud computing data center
- 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?
- Pytest multi process / multi thread execution test case
- vim正确加区间注释
- 疫情来袭--远程办公之思考|社区征文
- 【华为云IoT】读书笔记之《万物互联:物联网核心技术与安全》第3章(上)
- Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
- ctf-pikachu-CSRF
- Idea configuration 360zip open by default -- external tools
猜你喜欢

JSON string conversion in unity

Rhcsa-- day one

JVM family -- monitoring tools

Msgraphmailbag - search only driveitems of file types

Recursive structure

Management and thesis of job management system based on SSM

Sales management system of lightweight enterprises based on PHP

深度优先搜索简要讲解(附带基础题)

idea修改主体颜色

基于PHP的轻量企业销售管理系统
随机推荐
Calculate the odd sum of 1~n (1~100 as an example)
XSS prevention
[paddleseg source code reading] paddleseg custom data class
Objective-C string class, array class
Objective C attribute keyword
The three-year revenue is 3.531 billion, and this Jiangxi old watch is going to IPO
Perf simple process for multithreaded profile
The maximum expiration time of client secret in azure ad application registration is modified to 2 years
Katalon framework test web (XXVI) automatic email
基于PHP的轻量企业销售管理系统
Third party login initial version
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
[Yugong series] go teaching course 002 go language environment installation in July 2022
*. No main manifest attribute in jar
[untitled]
How to dynamically cache components in Vue multi-level route nesting
The new data center helps speed up the construction of a digital economy with data as a key element
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
ctf-pikachu-XSS
Package details_ Four access control characters_ Two details of protected