知识卡片
消息顺序只需覆盖作用域
消息 ID 应唯一且能支持所需顺序,单靠创建时间可能遇到同一时刻多条消息。若只要求频道内有序,可采用局部序列;无需为不存在的全局顺序要求付出更多协调成本。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
- · 第12章 聊天
原书出处 · 1 处
- 聊天 · 查看原书依据
Message ID How to generate message_id is an interesting topic worth exploring. Message_id carries the responsibility of ensuring the order of messages. To ascertain the order of messages, message_id must satisfy the following two requirements: •IDs must be unique. •IDs should be sortable by time, meaning new rows have higher IDs than old ones. How can we achieve those two guarantees? The first idea that
参考来源
- 位置:《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_002.html)
- 结论依据:原文在该位置给出所述对象、机制或比较,支持本卡的解释;原书未展开的实现不作为已证明结论,算式与一致性边界在正文明确限定。
- 原始内容:Message ID How to generate message_id is an interesting topic worth exploring. Message_id carries the responsibility of ensuring the order of messages. To ascertain the order of messages, message_id must satisfy the following two requirements: •IDs must be unique. •IDs should be sortable by time, meaning new rows have higher IDs than old ones. How can we achieve those two guarantees? The first idea that