write-read-path.d2 1.09 KB
Newer Older
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
51
52
53
54
55
56
57
58
59
60
61
# Flash Indexer: Write/Read Path (grid layout with containers)
# Tree placed inside Read Path for grid alignment; container border
# adjusted in SVG post-processing to exclude it.
# Read Lock label + arrow added in SVG post-processing.
...@theme.d2

direction: right

writes: Write Path {
  class: container_l1
  grid-rows: 3
  grid-gap: 150

  ev: KV Events {
    shape: queue
    class: event
    width: 300
    height: 72
  }
  sr: Sticky Router {
    class: load_balancer
    width: 300
    height: 72
  }
  pool: "Thread Pool (x3)" {
    class: cpu
    width: 300
    height: 72
  }

  ev -> sr { class: data_flow }
  sr -> pool { class: control_flow }
}

reads: Read Path {
  class: container_l1
  grid-rows: 3
  grid-gap: 150

  req: Incoming Request {
    shape: hexagon
    class: neutral
    width: 300
    height: 72
  }
  fm: "find_matches()" {
    class: api
    width: 300
    height: 72
  }
  tree: Concurrent Radix Tree {
    shape: cylinder
    class: database
    width: 300
    height: 72
  }

  req -> fm { class: control_flow }
}

writes.pool -> reads.tree: Write Lock { class: critical_path }