← 返回刚才阅读的位置

知识卡片

问题卡 · 4478

在线状态按群规模分发

理解等级:高级

小群可通过发布订阅及时推送好友状态,大群每次状态变化都广播会产生巨大事件量。可改为进入群组或手动刷新时查询,降低扇出;代价是状态新鲜度与即时性的变化。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 聊天 · 查看原书依据

      Online status fanout How do user A’s friends know about the status changes? Figure 12-19 explains how it works. Presence servers use a publish-subscribe model, in which each friend pair maintains a channel. When User A’s online status changes, it publishes the event to three channels, channel A-B, A-C, and A-D. Those three channels are subscribed by User B, C, and D, respectively. Thus, it

    参考来源

    - 位置:《System Design Interview – An insiders guide, Second Edition》第12章《聊天》(来源项目 book-sources;源文件:extracted/System Design Interview – An insiders guide, Second Edition/_epub-src/text/part0029_split_003.html) - 结论依据:原文在该位置给出所述对象、机制或比较,支持本卡的解释;原书未展开的实现不作为已证明结论,算式与一致性边界在正文明确限定。 - 原始内容:Online status fanout How do user A’s friends know about the status changes? Figure 12-19 explains how it works. Presence servers use a publish-subscribe model, in which each friend pair maintains a channel. When User A’s online status changes, it publishes the event to three channels, channel A-B, A-C, and A-D. Those three channels are subscribed by User B, C, and D, respectively. Thus, it