← 返回刚才阅读的位置

知识卡片

问题卡 · 4442

雪花ID拆分唯一性空间

理解等级:高级

雪花式 ID 把 64 位划成符号、时间戳、机房、机器与毫秒内序列。不同机器用不同身份,同一机器同毫秒用递增序列,组合避免冲突;这种保证依赖身份分配与时钟假设,不能只照抄位数。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 唯一ID · 查看原书依据

      Twitter snowflake approach Approaches mentioned above give us some ideas about how different ID generation systems work. However, none of them meet our specific requirements; thus, we need another approach. Twitter’s unique ID generation system called “snowflake” [3] is inspiring and can satisfy our requirements. Divide and conquer is our friend. Instead of generating an ID directly, we divide an ID into different sections. Figure

    参考来源

    - 位置:《System Design Interview – An insiders guide, Second Edition》第07章《唯一ID》(来源项目 book-sources;源文件:extracted/System Design Interview – An insiders guide, Second Edition/_epub-src/text/part0019_split_002.html) - 结论依据:原文在该位置给出所述对象、机制或比较,支持本卡的解释;原书未展开的实现不作为已证明结论,算式与一致性边界在正文明确限定。 - 原始内容:Twitter snowflake approach Approaches mentioned above give us some ideas about how different ID generation systems work. However, none of them meet our specific requirements; thus, we need another approach. Twitter’s unique ID generation system called “snowflake” [3] is inspiring and can satisfy our requirements. Divide and conquer is our friend. Instead of generating an ID directly, we divide an ID into different sections. Figure