当前位置:网站首页>毕业设计:设计秒杀电商系统
毕业设计:设计秒杀电商系统
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. 演进
边栏推荐
- Wechat official account web page authorization
- The new data center helps speed up the construction of a digital economy with data as a key element
- I Build a simple microservice project
- Penetration practice - sqlserver empowerment
- Myslq delete followed by limit
- 选择排序与冒泡排序模板
- logistic regression
- 微信公众号网页授权
- 深入浅出对话系统——使用Transformer进行文本分类
- [PaddleSeg 源码阅读] PaddleSeg 自定义数据类
猜你喜欢

The difference between bagging and boosting in machine learning

Session learning diary 1

02 ls 命令的具体实现

ctf-pikachu-CSRF

拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。

1289_FreeRTOS中vTaskSuspend()接口实现分析

idea修改主体颜色
![Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure](/img/ba/c1d40de154344ccc9f2fd1dd4cb12f.png)
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure

Global exposure and roller shutter exposure of industrial cameras

渗透实战-guest账户-mimikatz-向日葵-sql提权-离线解密
随机推荐
Katalon framework test web (XXVI) automatic email
2022-07-03:数组里有0和1,一定要翻转一个区间,翻转:0变1,1变0。 请问翻转后可以使得1的个数最多是多少? 来自小红书。3.13笔试。
Session learning diary 1
Perf simple process for multithreaded profile
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
[paddleseg source code reading] paddleseg custom data class
Package details_ Four access control characters_ Two details of protected
AAAI2022 | Word Embeddings via Causal Inference: Gender Bias Reducing and Semantic Information Preserving
【.NET+MQTT】.NET6 環境下實現MQTT通信,以及服務端、客戶端的雙邊消息訂閱與發布的代碼演示
Typical applications of minimum spanning tree
Two commonly used graphics can easily realize data display
ctf-pikachu-CSRF
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
函数计算异步任务能力介绍 - 任务触发去重
Deep thinking on investment
Katalon中控件的参数化
Recursive structure
vim映射命令
深度优先搜索简要讲解(附带基础题)
Apple submitted the new MAC model to the regulatory database before the spring conference