You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DOs are cells, not GPU cores. Code is DNA — every Fragment DO carries
the same WASM binary, activates on signal, processes local data, goes
dormant. Scale from more cells, not smarter ones.
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -338,13 +338,13 @@ const similar = await qm
338
338
339
339
WASM is slower than native (~1.3–1.5× overhead), and a single Durable Object has hard memory and CPU caps. You can't build a competitive query engine by running everything in one WASM instance on one node.
340
340
341
-
QueryMode doesn't try. It uses the network as a distributed compute fabric:
341
+
QueryMode doesn't try. It uses the network as a distributed compute fabric — like biological cells, not a brain:
342
342
343
-
-**DOs as parallel compute units** — one Fragment DO per fragment, each processing a small shard of column pages with WASM SIMD. Scale out, not up. Idle DOs cost nothing (they hibernate).
343
+
-**DOs as cells** — every Fragment DO carries the same WASM binary (DNA). They activate on signal, scan their fragment, and go dormant. More data → more cells. Idle cells cost nothing (they hibernate).
344
344
-**R2 as virtual memory** — when a single DO's 128MB fills up, operators spill to R2. The pipeline doesn't care if data is in-memory or spilled — same interface, unbounded capacity.
345
-
-**Fan-out as bandwidth** — more fragments = more parallel R2 reads = more aggregate throughput.
345
+
-**Fan-out as bandwidth** — more fragments = more parallel R2 reads = more aggregate throughput. No cell coordinates with another — they all respond to the same signal independently.
346
346
347
-
QueryDO **maps** fragments to Fragment DOs, each DO runs WASM SIMD on its shard, then QueryDO **reduces** via k-way merge. No single node does heavy work. See [Architecture](https://teamchong.github.io/querymode/architecture/) for the full deep dive.
347
+
QueryDO **maps** fragments to Fragment DOs, each DO runs WASM SIMD on its shard, then QueryDO **reduces** via k-way merge. No single node does heavy work. The code is the DNA — scale comes from more cells, not smarter ones. See [Architecture](https://teamchong.github.io/querymode/architecture/) for the full deep dive.
Copy file name to clipboardExpand all lines: docs/src/content/docs/architecture.mdx
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,19 +56,21 @@ One per fragment — scales with data, no hard cap. Each scans its assigned frag
56
56
5.**QueryDO** merges partial results via k-way merge
57
57
6.**Response** returned as JSON or streaming columnar format
58
58
59
-
## Mental model: DOs as GPU cores
60
-
61
-
Every Fragment DO runs the same WASM binary — like GPU cores running the same shader. They don't think; they execute. The QueryDO is the CPU: it decides what to dispatch, then collects and merges results.
62
-
63
-
| GPU | QueryMode |
64
-
|-----|-----------|
65
-
| CPU dispatches kernel | QueryDO maps fragments to Fragment DOs |
66
-
| All cores run same shader | All DOs run same WASM binary |
67
-
| Each core processes one tile | Each DO scans one fragment |
68
-
| Cores don't talk to each other | Fragment DOs are isolated |
69
-
| CPU collects results | QueryDO reduces via k-way merge |
70
-
| More data → more thread blocks | More fragments → more DOs |
Every Fragment DO runs the same WASM binary — like cells sharing the same DNA. No cell knows the whole organism. No central brain directs them. They activate on signal, do their work, and go dormant.
62
+
63
+
| Biology | QueryMode |
64
+
|---------|-----------|
65
+
| DNA (shared code) | Same WASM binary on every DO |
66
+
| Cell activates on signal | DO wakes on RPC, hibernates when idle |
67
+
| Each cell processes local inputs | Each DO scans its own fragment |
68
+
| Cells don't coordinate with each other | Fragment DOs are isolated |
69
+
| Body collects and integrates | QueryDO reduces via k-way merge |
70
+
| More tissue → more cells | More fragments → more DOs |
The code is the DNA of these cells — every Fragment DO carries the same WASM engine, responds to the same signals (scan, filter, aggregate), and produces the same output format. Scale comes from having more cells, not smarter ones.
72
74
73
75
The fan-out decision is workload-aware: small scans run locally in the QueryDO (no RPC overhead), large scans dispatch to Fragment DOs for parallel execution. No configuration — the engine decides based on estimated rows after pruning.
0 commit comments