Skip to content

Commit 7dc380c

Browse files
committed
docs: replace GPU analogy with bio-cell model
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.
1 parent 42e0961 commit 7dc380c

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,13 @@ const similar = await qm
338338

339339
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.
340340

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:
342342

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).
344344
- **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.
346346

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.
348348

349349
## License
350350

docs/src/content/docs/architecture.mdx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,21 @@ One per fragment — scales with data, no hard cap. Each scans its assigned frag
5656
5. **QueryDO** merges partial results via k-way merge
5757
6. **Response** returned as JSON or streaming columnar format
5858

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 |
71-
| Idle cores cost nothing | Idle DOs hibernate (zero cost) |
59+
## Mental model: biological cells, not a brain
60+
61+
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 |
71+
| Dormant cells cost nothing | Idle DOs hibernate (zero cost) |
72+
73+
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.
7274

7375
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.
7476

0 commit comments

Comments
 (0)