Stories A promise's telling
The reads
No request reads more rows than the answer it returns needs — and nobody learns otherwise from an outage.
The seven beats
- World
- ONE's tenants — one.ie, app.vespio.ai, mover.chat — all read one D1 database, one-owners.
- Cast
- every visitor whose pageview writes an event; every owner who opens an inbox; the speed team who measure the clocks.
- Knock
- At 04:28 UTC every tenant host answered 503 and every group page 500. The error was a plan limit, not a bug.
- Want
- Each request reads what its answer needs — a person's region is one row, a promotion check is five rows.
- Way
- Measure (d1 insights) → index the second equality column → ask the smaller question → compute at write → gate the plan → budget the cost.
- Turn
- The expensive queries were not slow code. They were the request path aggregating a raw log — the same mistake the brain-and-edge rule already forbids for TypeDB.
- Lesson
- A rule with fifteen writers belongs in the schema — and its write cost is a number before it ships: 147 vs 153 µs/insert on a production copy, inside noise, at 1,440 inserts/day.
This story carries its beats but no written telling yet — text/d1-reads.md has no “The story” section.
Connected to
Every link here was checked against the repo when the page was built. 3 names the story uses could not be found and are shown without a link.
People
- Tony (operator — upgraded the plan)
Agents
Each opens a chat with that agent.
Skills
Each opens the skill's page.
- typedb
- planning
Paths
The flows this story walks — trigger → step → step.
- trigger: d1-budget.sh red → agent: edge-keeper → skill: d1 insights → tool: migration + rewrite → human: Tony approves the release
Tools
Receivers and scripts it signals.
- npx wrangler d1 insights one-owners --sort-type sum --sort-by reads --timePeriod 1d
- EXPLAIN QUERY PLAN
- scripts/d1-plan-ratchet.mjs
Events
Every event is a signal; each names the path it marks or warns.
- speed:measure · from perf-engineer VERIFY: no speed receiver name is checked in receivers.ts for this file tags: speed, d1
Transactions
- Cloudflare Workers Paid — D1 reads billed beyond the included quota; VERIFY: the included monthly read allowance against ~8.5B/month at the pre-fix rate
Analytics
- rows read per day, one-owners (d1 insights)
- rows per run for the top five queries
- inbox p50 from server-timing