知识卡片

问题卡 · 4475

设备游标支持增量同步

理解等级:中级

每台设备保存自己已看到的最大消息 ID,读取属于当前用户且 ID 更大的消息。不同设备分别推进游标,便于离线后补齐;这一方法依赖消息身份及排序承诺,而非只记最后打开应用的时间。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 聊天 · 查看原书依据

      Message synchronization across multiple devices Many users have multiple devices. We will explain how to sync messages across multiple devices. Figure 12-13 shows an example of message synchronization. In Figure 12-13, user A has two devices: a phone and a laptop. When User A logs in to the chat app with her phone, it establishes a WebSocket connection with Chat server 1. Similarly, there is

    参考来源

    - 位置:《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) - 结论依据:原文在该位置给出所述对象、机制或比较,支持本卡的解释;原书未展开的实现不作为已证明结论,算式与一致性边界在正文明确限定。 - 原始内容:Message synchronization across multiple devices Many users have multiple devices. We will explain how to sync messages across multiple devices. Figure 12-13 shows an example of message synchronization. In Figure 12-13, user A has two devices: a phone and a laptop. When User A logs in to the chat app with her phone, it establishes a WebSocket connection with Chat server 1. Similarly, there is