Scaling
rubberduck’s default is quick and easy: DuckDB-WASM on Workers, Parquet on R2, metadata in D1. Scale to zero, deploy with wrangler. This page is only for when a query outgrows the Worker envelope.
Default tier: Worker duckling
| Compute | Workers + @ducklings/workers |
| Storage | R2 Parquet under org_*/ |
| Control | D1 (orgs, ducklings, metrics) |
| Idle cost | ~$5/mo Workers Paid floor + R2 |
| Working set | ~48 MB Parquet gate, 64 MB DuckDB RAM |
Most embedded analytics fits here: bursty queries, mostly-idle tenants, SF0.1–1M-row facts. You pay CPU-ms when someone actually queries — not rows-read on every full scan.
When to graduate
Move compute, not data, when:
- Parquet working set exceeds the ~48 MB gate
- High-cardinality aggs spill past 64 MB (
pnpm memory-boundaryin the repo) - You need sustained multi-GB hot scans or hard low-latency SLOs
The lake stays on R2. Only the duckling placement changes.
Placement without copy
org_acme
│
├── worker duckling ──┐
│ ├──▶ r2://…/org_acme/** (unchanged)
└── native duckling ──┘Placement is metadata. Moving an org Worker → native must not require copying Parquet.
Local lab (pnpm demo) flips placement and checks content hashes are unchanged. On the hosted Cloudflare path, native graduation is still P1 (HTTP 501 today) — the invariant is proven; the wiring is not.
Native duckling (graduation target)
Same contract, bigger envelope:
| Worker | Native | |
|---|---|---|
| RAM | ~64 MB | GiB-scale |
| Threads | 1 | many |
| Idle | scales to zero | pool / on-demand |
| Same R2 prefix | yes | yes |
Options on Cloudflare: Containers, larger Workers limits over time, or an external native DuckDB pool (Fly, celld) with scoped R2 credentials.
What not to do
- Don’t stuff analytical tables in D1 and hope it scales — row-store full scans are the wrong economics. See Numbers.
- Don’t copy Parquet when you graduate — update placement in D1, point the duckling at the same prefix.
- Don’t run a always-on warehouse for tenants that query once a week.
Related
- Limits — Worker envelope numbers
- Numbers — DuckDB vs D1/SQLite bake-off
- How it works — architecture overview