← 返回刚才阅读的位置

知识卡片

结构图卡 · 10294.a.4.a.2.c.1.b.9.c.3 · 生成模型:未记录

Merkle树定位差异范围

理解等级:高级

叶子保存数据范围的哈希,父节点由子节点哈希得出。两副本先比根,碰到不同的子树才递归往下,最终定位要交换数据的范围。范围越细,定位越精确,节点数和交换的哈希越多,数据变化也要重算相关哈希。

结构图:

flowchart TD
A[比较两棵树的根] --> B{摘要相同}
B -->|是| C[跳过该范围]
B -->|否| D{已经是叶子}
D -->|否| E[对子范围递归比较]
E --> B
D -->|是| F[比对并修复该数据范围]
这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Database Internals》Chapter 12. Anti-Entropy and Dissemination(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch12.html#merkle_trees,段 38) - 结论依据:原文正向说明构建范围摘要树,反向说明根到叶比较及精度成本。 - 原始内容:Merkle trees compose a compact hashed representation of the local data, building a tree of hashes. The lowest level of this hash tree is built by scanning an entire table holding data records, and computing hashes of record ranges.