模块二作业 -- 图片字小,可以放大网页观看
业务指标:截止 2021 年一月的数据,每天平均 1.2 亿人发朋友圈,假设在 16 小时内发送,每秒在 2083 次,也就是说在万级别的 TPS 应该可以承受这个访问量
业务处理:
先业务分解,分成发送,浏览和评论三个子系统;
再业务分配,各子系统内利用负载均衡,进行分配
如有必要,可以考虑接队列系统,缓冲前端的高流量。但考虑成本和维护的简易性,本方案目前没有考虑,待后续系统演进,视流量增幅再升级添加。
存储系统:mongoDB sharding 按照 user id 进行分片。因为业务以 user id 为基础进行,也不需要精确的事务,达到最终一致即可。
缓存系统:redis 有助于朋友圈浏览和点赞等业务。





评论