当前位置:网站首页>毕业设计:设计秒杀电商系统
毕业设计:设计秒杀电商系统
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. 演进
边栏推荐
- 【罗技】m720
- A review of reverse reinforcement learning at Virginia Tech (VT)
- [.NET + mqtt]. Mise en œuvre de la communication mqtt dans l'environnement net 6 et démonstration de code pour l'abonnement et la publication de messages bilatéraux du serveur et du client
- 函数计算异步任务能力介绍 - 任务触发去重
- [paddleseg source code reading] paddleseg calculates Miou
- Huawei cloud Kunpeng engineer training (Guangxi University)
- The maximum expiration time of client secret in azure ad application registration is modified to 2 years
- Wechat official account web page authorization
- Apple submitted the new MAC model to the regulatory database before the spring conference
- There is a problem that the package cannot be parsed in the like project
猜你喜欢
![[PaddleSeg 源码阅读] PaddleSeg 自定义数据类](/img/88/37c535b371486db545abc392a685af.png)
[PaddleSeg 源码阅读] PaddleSeg 自定义数据类

图解网络:什么是热备份路由器协议HSRP?

SQL statement strengthening exercise (MySQL 8.0 as an example)

Katalon中控件的参数化

LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(main.obj 中)

laravel admin里百度编辑器自定义路径和文件名

Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)

Management and thesis of job management system based on SSM

1289_ Implementation analysis of vtask suspend() interface in FreeRTOS

还原窗口位置的微妙之处
随机推荐
[Huawei cloud IOT] reading notes, "Internet of things: core technology and security of the Internet of things", Chapter 3 (I)
Aperçu du code source futur - série juc
Introduction to asynchronous task capability of function calculation - task trigger de duplication
Getting started with the go language is simple: go implements the Caesar password
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
Katalon使用script实现查询List大小
JVM family -- heap analysis
三菱M70宏变量读取三菱M80公共变量采集三菱CNC变量读取采集三菱CNC远程刀补三菱机床在线刀补三菱数控在线测量
[paddleseg source code reading] normalize operation of paddleseg transform
LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(main.obj 中)
Apple submitted the new MAC model to the regulatory database before the spring conference
基于PHP的轻量企业销售管理系统
JS实现文字滚动 跑马灯效果
Sales management system of lightweight enterprises based on PHP
Typical applications of minimum spanning tree
Es network layer
SDP中的SPA
I was tortured by my colleague's null pointer for a long time, and finally learned how to deal with null pointer
JDBC 进阶
Pytest multi process / multi thread execution test case