当前位置:网站首页>微博评论架构设计
微博评论架构设计
2022-06-29 10:27:00 【InfoQ】
1. 业务背景
- 用户写评论并点击发评论按钮
- 评论发到微博文章评论区
- 看微博时会显示部分评论
- 用户点击更多评论后,评论区显示更多评论
2. 约束和限制
3. 总体计算架构
3.1 分析评估
3.1.1 性能需求
3.1.2 高可用
3.2 微博评论高性能计算架构设计


3.2.1 非热点事件高性能设计
- 在不定时刷新情况下使用缓冲,给被动缓存加上失效时间,失效后重新从数据库读取缓存。多个缓存设置不同失效时间。
- 由于评论不断增加,可以定时刷新,也可以采用主动更新策略,让后台程序更新评论。
- 如果看评论请求实在无法处理,可直接丢弃,用户再次请求时处理就可以。
3.2.2 热点事件高性能设计
- 增大评论队列长度
- 增加评论服务器数量
- 增加多个缓存服务器,并设置不同失效时间
- 无法处理就直接丢弃
3.2.3 热点事件高可用设计
- 限流:控制评论数目。客户端设置时钟,倒计时完成后才可再发评论,并解释在规定时间内只允许发有限评论。也可以在服务网关中直接拒绝评论请求。当接收微博评论数目大于应用服务队列时,直接丢弃评论,并提示用户无法评论失败。
- 熔断:可暂时关闭部分用户评论,如果用户在短时间内发过多评论,就暂时提示用户在一段时间内无法再发评论。
- 降级:观察热点,当对系统负载过大时,可人工暂时关闭评论功能。
4. 详细设计
4.1 核心功能
4.1.1 发评论

- 只要队列不满,写入写评论请求后,即可返回成功到客户端
- 队列已满的话,丢弃写评论请求,返回失败到客户端
4.1.2 读评论

4.2 关键设计
4.3 设计规范
5. 质量设计
6. 演进规划
边栏推荐
- 数据分析方法与思维:漏斗分析
- USB to RS485 serial port circuit design "suggestions collection"
- 通过网上进行股票开户安全吗
- 工具箱之 IKVM.NET 项目新进展
- (JS) observer mode
- [daily 3 questions (1)] judge the color of a grid on the chess board
- Modbustcp protocol network learning single channel infrared module (medium shell version)
- 涂鸦云开发 demo 登录
- Modbus RTU protocol 485 learning 2-way infrared module
- [untitled] I am plotting a big event
猜你喜欢

Multi thread communication between client and server (primary version)

Data analysis method and Thinking: funnel analysis

Xuetong denies that the theft of QQ number is related to it: it has been reported; IPhone 14 is ready for mass production: four models are launched simultaneously; Simple and elegant software has long

【每日3题(3)】重新格式化电话号码

极限导论总结
![[various * * question series] what are OLTP and OLAP?](/img/3f/48b4108d14d40212f678971c1b62bb.png)
[various * * question series] what are OLTP and OLAP?

中国计算语言学大会、全国知识图谱与语义计算大会赛题火热进行中

math_数学表达式&等式方程的变形&组合操作技巧/手段积累

在线SQL转HTMLTable工具

多线程高并发服务器:3个问题
随机推荐
【各种**问题系列】OLTP和OLAP是啥?
(JS)模仿一个instanceof方法
(JS)数组的 pop、push、unshift、shift分别是什么?
(JS)职责链模式
(JS) array flat
由ASP.NET Core根据路径下载文件异常引发的探究
(JS) imitate the indexof method to find the position of a character in the string
Pipeline aggregations管道聚合-Sibling-1
Ikvm Net project progress
5.移植uboot-设置默认环境变量,裁剪,并分区
Easydss is deployed on Disk C, and the video playback cannot be played normally. How to solve this problem?
Specific method and example program of Siemens s7-200smart control stepping motor
math_ Mathematical expression & deformation of equation equation & accumulation of combined operation skills / means
(JS)观察者模式
如何识别出轮廓准确的长和宽
掌握一些shell 通配符巧妙的运用,会让我们写脚本事半功倍
Modbustcp protocol WiFi wireless learning single channel infrared module (round shell version)
When a technician becomes a CEO, what "bugs" should be modified?
Graduation season · advanced technology Er - workers in the workplace
VI exit exit VIM applicable novice