当前位置:网站首页>缓存综合项目--秒杀架构
缓存综合项目--秒杀架构
2022-06-27 03:49:00 【喵叔哟】
前面几篇文章我们学习了读缓存、写缓存和数据收集的场景,在这篇文章中我们将综合这三个方面来实现一个秒杀架构。
秒杀架构的特点是 僧多粥少,一般来说商品会在两秒内被抢光,后续进来的用户只能看到秒杀结束的界面,因此秒杀开始的前两秒中会出现一个流量峰值。并且秒杀架构设计时要保证商品不能被超卖、下单数据不能丢失、服务器与数据库不能崩溃、尽最大可能屏蔽机器人抢走商品。下面针对这四个方面我们来讲解一下。
一、实现思路
1.1 架构简述
秒杀架构就是一个不断过滤请求的过程,一般来说秒杀系统分为5层:静态资源/负载均衡、网关、后台服务器、缓存和数据库。我们尽量会在第一层和第二层对用户请求进行处理,关于怎么将请求拦截在第一层和第二层的问题,需要结合实际业务来考虑。
1.2 思路
秒杀系统的业务流程分为四层:展示页面、下单、付款和结果。下面就针业务流程的四层分别来讲解一下实现思路。
1.2.1 展示页面拦截请求
对于商品展示页面,我们大部分情况会使用到内容分发网络,也就是常说的CDN,使用CDN的优点是我们不需要花费自己的服务器资源,并且响应速度快,可以把静态资源的压力转嫁到外部系统。
既然有静态资源ÿ
边栏推荐
- 2021:Greedy Gradient Ensemble for Robust Visual Question Answering
- 文旅灯光秀打破时空限制,展现景区夜游魅力
- Quicksand painting simulator source code
- 事业观、金钱观与幸福观
- PAT甲级 1025 PAT Ranking
- Fplan power planning
- 2021:Graphhopper: Multi-Hop Scene Graph Reasoning for Visual Question Answering
- Is the truth XX coming? Why are test / development programmers unwilling to work overtime? This is a crazy state
- [Shangshui Shuo series] day 6
- 2021:Beyond Question-Based Biases:Assessing Multimodal Shortcut Learning in Visual Question Answeri
猜你喜欢

2021:Beyond Question-Based Biases:Assessing Multimodal Shortcut Learning in Visual Question Answeri

办公室VR黄片,骚操作!微软HoloLens之父辞职!

文旅灯光秀打破时空限制,展现景区夜游魅力
![Basic functions of promise [IV. promise source code]](/img/a0/8f28ec8951088b8e66e7079432f326.png)
Basic functions of promise [IV. promise source code]

Baidu PaddlePaddle's "universal gravitation" first stop in 2022 landed in Suzhou, comprehensively launching the SME empowerment plan

ERP demand and sales management Kingdee
![[Shangshui Shuo series] day 6](/img/47/7cd44f4e361af53cac7cea9d0d7ecb.png)
[Shangshui Shuo series] day 6

2021:Graphhopper: Multi-Hop Scene Graph Reasoning for Visual Question Answering

卷积神经网络(CNN)网络结构及模型原理介绍

fplan-Powerplan实例
随机推荐
SAI钢笔工具如何使用,入门篇
2021:Check it again:Progressive Visual Question Answering via Visual Entailment通过视觉暗示进行渐进式视觉问答
快速掌握 ASP.NET 身份认证框架 Identity - 通过邮件重置密码
Pat grade a 1021 deep root
2019LXMERT:Learning Cross-Modality Encoder Representations from Transformers
Is the money invested in financial products guaranteed? Is there no more?
Fplan layout
Kotlin Compose compositionLocalOf 与 staticCompositionLocalOf
Is the truth XX coming? Why are test / development programmers unwilling to work overtime? This is a crazy state
Games101 job 7 improvement - implementation process of micro surface material
2022 operation of simulated examination platform for tea artist (Senior) work license question bank
PostgreSQL基础命令教程:创建新用户admin来访问PostgreSQL
LDR6028 手机设备一边充电一边OTG传输数据方案
2021:AdaVQA: Overcoming Language Priors with Adapted Margin Cosine Loss∗自适应的边缘余弦损失解决语言先验
Knowledge of iPhone certificate structure
There are two problems when Nacos calls microservices: 1 Load balancer does not contain an instance for the service 2. Connection refused
PAT甲级 1020 Tree Traversals
JMeter takes the result of the previous request as the parameter of the next request
Fplan powerplan instance
A^2=E | 方程的解 | 这个方程究竟能告诉我们什么