Diffinery

homeflare/celldpublic

celld/docs/services/durable-object-facets-flow.svg
127 lines · 7.6 KBRaw History
1<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 440 372" role="img">
2 <title>Several facets share one cell, one owner node, and one replication stream, while separate Durable Objects each take their own owner record and node</title>
3 <desc>Two arrangements of the same three application databases. On the left, a
4Worker calls one supervisor cell on node B at epoch e4. That single cell holds
5the supervisor's SQLite database and, in separate databases beside it, the
6facets app-a and app-b. One owner record and one stream under
7cells/acct-9/ltx/e4/ cover all of them, so the call takes one hop and one output
8gate. On the right, the same three databases are three separate Durable Object
9cells on nodes B, C, and A. Each cell holds its own owner record and its own
10epoch, and the three replicate under three prefixes, so a call takes a hop and
11an output gate for each object.</desc>
12 <style>
13 .d-ink { color: #121212 }
14 .d-soft { color: #3d3b37 }
15 .d-faint { color: #6e6a62 }
16 .d-acc { color: #10803f }
17 .d-panel { color: #ffffff }
18 .d-sunk { color: #f0eee8 }
19 .d-tint { color: #d6efdf }
20 text {
21 font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
22 font-size: 13px;
23 fill: currentColor;
24 }
25 tspan { fill: currentColor; }
26 @media (prefers-color-scheme: dark) {
27 .d-ink { color: #efede7 }
28 .d-soft { color: #c9c6be }
29 .d-faint { color: #928e85 }
30 .d-acc { color: #3fc472 }
31 .d-panel { color: #1a1a19 }
32 .d-sunk { color: #232321 }
33 .d-tint { color: #10301d }
34 }
35 </style>
36 <defs>
37 <marker id="facet-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6"
38 markerHeight="6" orient="auto-start-reverse">
39 <path class="d-soft" fill="currentColor" d="M0 0 L10 5 L0 10 z" />
40 </marker>
41 </defs>
42
43 <!-- Column captions: one object with facets, against separate objects. -->
44 <text class="d-ink" fill="currentColor" x="110" y="14" text-anchor="middle">one object, two facets</text>
45 <text class="d-ink" fill="currentColor" x="330" y="14" text-anchor="middle">three separate objects</text>
46
47 <!-- The same caller in both arrangements. -->
48 <rect class="d-panel" fill="currentColor" x="6" y="24" width="208" height="32" rx="6" />
49 <rect class="d-soft" fill="none" stroke="currentColor" x="6" y="24" width="208" height="32" rx="6" />
50 <text class="d-soft" fill="currentColor" x="110" y="45" text-anchor="middle">Worker</text>
51
52 <rect class="d-panel" fill="currentColor" x="226" y="24" width="208" height="32" rx="6" />
53 <rect class="d-soft" fill="none" stroke="currentColor" x="226" y="24" width="208" height="32" rx="6" />
54 <text class="d-soft" fill="currentColor" x="330" y="45" text-anchor="middle">Worker</text>
55
56 <!-- One dispatch on the left; one dispatch for each object on the right. -->
57 <g class="d-soft" fill="none" stroke="currentColor" stroke-width="1.5">
58 <path d="M110 56 V74" marker-end="url(#facet-arrow)" />
59 <path d="M330 56 V66 H234 V219" />
60 <path d="M234 99 H246" marker-end="url(#facet-arrow)" />
61 <path d="M234 159 H246" marker-end="url(#facet-arrow)" />
62 <path d="M234 219 H246" marker-end="url(#facet-arrow)" />
63 </g>
64
65 <!-- One cell, one owner, one epoch, and two private databases inside it. -->
66 <rect class="d-tint" fill="currentColor" x="6" y="74" width="208" height="172" rx="6" />
67 <rect class="d-acc" fill="none" stroke="currentColor" stroke-width="2" x="6" y="74" width="208" height="172" rx="6" />
68 <text class="d-ink" fill="currentColor" x="110" y="95" text-anchor="middle">supervisor cell</text>
69 <text class="d-soft" fill="currentColor" x="110" y="112" text-anchor="middle">node B · epoch e4</text>
70
71 <rect class="d-sunk" fill="currentColor" x="16" y="122" width="188" height="34" rx="6" />
72 <rect class="d-soft" fill="none" stroke="currentColor" x="16" y="122" width="188" height="34" rx="6" />
73 <text class="d-ink" fill="currentColor" x="110" y="144" text-anchor="middle">supervisor SQLite</text>
74
75 <g class="d-faint" fill="none" stroke="currentColor" stroke-dasharray="5 4">
76 <path d="M16 168 H46" />
77 <path d="M174 168 H204" />
78 </g>
79 <text class="d-faint" fill="currentColor" x="110" y="172" text-anchor="middle">separate databases</text>
80
81 <rect class="d-sunk" fill="currentColor" x="16" y="180" width="90" height="56" rx="6" />
82 <rect class="d-soft" fill="none" stroke="currentColor" x="16" y="180" width="90" height="56" rx="6" />
83 <text class="d-ink" fill="currentColor" x="61" y="202" text-anchor="middle">facet app-a</text>
84 <text class="d-soft" fill="currentColor" x="61" y="221" text-anchor="middle">own SQLite</text>
85
86 <rect class="d-sunk" fill="currentColor" x="114" y="180" width="90" height="56" rx="6" />
87 <rect class="d-soft" fill="none" stroke="currentColor" x="114" y="180" width="90" height="56" rx="6" />
88 <text class="d-ink" fill="currentColor" x="159" y="202" text-anchor="middle">facet app-b</text>
89 <text class="d-soft" fill="currentColor" x="159" y="221" text-anchor="middle">own SQLite</text>
90
91 <!-- The same three databases as three cells, each with its own owner. -->
92 <rect class="d-panel" fill="currentColor" x="246" y="74" width="176" height="50" rx="6" />
93 <rect class="d-soft" fill="none" stroke="currentColor" x="246" y="74" width="176" height="50" rx="6" />
94 <text class="d-ink" fill="currentColor" x="334" y="95" text-anchor="middle">APP-A cell · node B</text>
95 <text class="d-soft" fill="currentColor" x="334" y="112" text-anchor="middle">own owner record · e4</text>
96
97 <rect class="d-panel" fill="currentColor" x="246" y="134" width="176" height="50" rx="6" />
98 <rect class="d-soft" fill="none" stroke="currentColor" x="246" y="134" width="176" height="50" rx="6" />
99 <text class="d-ink" fill="currentColor" x="334" y="155" text-anchor="middle">APP-B cell · node C</text>
100 <text class="d-soft" fill="currentColor" x="334" y="172" text-anchor="middle">own owner record · e9</text>
101
102 <rect class="d-panel" fill="currentColor" x="246" y="194" width="176" height="50" rx="6" />
103 <rect class="d-soft" fill="none" stroke="currentColor" x="246" y="194" width="176" height="50" rx="6" />
104 <text class="d-ink" fill="currentColor" x="334" y="215" text-anchor="middle">APP-C cell · node A</text>
105 <text class="d-soft" fill="currentColor" x="334" y="232" text-anchor="middle">own owner record · e2</text>
106
107 <!-- One stream against three streams. -->
108 <g class="d-soft" fill="none" stroke="currentColor" stroke-width="1.5">
109 <path d="M110 246 V272" marker-end="url(#facet-arrow)" />
110 <path d="M422 99 H428 V264 H330 V272" marker-end="url(#facet-arrow)" />
111 <path d="M422 159 H428" />
112 <path d="M422 219 H428" />
113 </g>
114
115 <rect class="d-sunk" fill="currentColor" x="6" y="272" width="208" height="52" rx="6" />
116 <rect class="d-soft" fill="none" stroke="currentColor" x="6" y="272" width="208" height="52" rx="6" />
117 <text class="d-ink" fill="currentColor" x="110" y="293" text-anchor="middle">cells/acct-9/ltx/e4/</text>
118 <text class="d-soft" fill="currentColor" x="110" y="311" text-anchor="middle">one stream covers all</text>
119
120 <rect class="d-sunk" fill="currentColor" x="226" y="272" width="208" height="52" rx="6" />
121 <rect class="d-soft" fill="none" stroke="currentColor" x="226" y="272" width="208" height="52" rx="6" />
122 <text class="d-ink" fill="currentColor" x="330" y="293" text-anchor="middle">three bucket prefixes</text>
123 <text class="d-soft" fill="currentColor" x="330" y="311" text-anchor="middle">three epochs</text>
124
125 <text class="d-faint" fill="currentColor" x="110" y="348" text-anchor="middle">one hop, one gate, one proof</text>
126 <text class="d-faint" fill="currentColor" x="330" y="348" text-anchor="middle">a hop and a gate for each</text>
127</svg>