aboutsummaryrefslogtreecommitdiffstats
path: root/docs/merkle-tree-hierarchy.puml
blob: 4e86e26a7da445aa9a8239ddb3e8e19f341f5db3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@startuml merkle-tree-hierarchy
!theme plain
title Merkle Tree Hierarchy

package "Database Level" {
  [Database Hash] as DBHash
  database "Merkle Tree of Relations" as DBTree
}

package "Relation Level" {
  [Relation Hash 1] as R1Hash
  [Relation Hash 2] as R2Hash
  [Relation Hash N] as RNHash

  database "Merkle Tree of Tuples (R1)" as R1Tree
  database "Merkle Tree of Tuples (R2)" as R2Tree
}

package "Tuple Level" {
  [Tuple Hash 1.1] as T11
  [Tuple Hash 1.2] as T12
  [Tuple Hash 2.1] as T21
  [Tuple Hash 2.2] as T22
}

DBHash --> DBTree
DBTree --> R1Hash
DBTree --> R2Hash
DBTree --> RNHash

R1Hash --> R1Tree
R2Hash --> R2Tree

R1Tree --> T11
R1Tree --> T12
R2Tree --> T21
R2Tree --> T22

note bottom of DBHash
  Single hash represents
  entire database state

  Benefits:
  - Version control
  - Efficient diffing
  - Distributed sync
  - Integrity verification
end note

@enduml