Skip to content

rubberduck docs

Scales to zero · 25× faster groupbys · stay on Cloudflare

Why this exists

Per-tenant analytics on Cloudflare should be quick and easy — not a second platform, not a always-on warehouse, not full-table scans through D1.

rubberduck is a hypertenant analytic database built from stuff you already have: R2 for Parquet, Workers for DuckDB SQL, D1 for org metadata. Drop files, run SQL, scale to zero. That's it.

Faster than D1 — by a lot

D1 is SQLite. Perfect for orgs, keys, and duckling metadata. Terrible for repeated full scans on analytical data.

Same 1M ClickBench-shaped rows, in-process (SQLite ≈ D1 engine vs DuckDB):

queryD1-class (sqlite)DuckDBspeedup
GROUP BY OSName244ms10ms25×
region avg235ms2.4ms98×

count(*) looks similar. Aggs do not. That’s why the lake lives in R2 and SQL runs in DuckDB on Workers — not in D1 tables.

D1 also meters rows read. A full 1M-row groupby costs ~1M rows per query. Workers meter CPU-ms instead. For bursty embedded analytics, that economics swap is the point.

Scale to zero

Most tenants are idle most of the time. Billing them like an always-on warehouse loses money.

rubberduck ducklings are disposable compute over durable Parquet. Query → Worker wakes → DuckDB scans R2 → done. Idle floor is roughly the Workers Paid minimum (~$5/mo) plus cheap R2 storage — not warm CU 24/7.

Cloudflare-native stack

PlaneServiceJob
ControlD1orgs, ducklings, metrics
DataR2Parquet lake org_*/…
ComputeWorkersDuckDB-WASM SQL

Everything deploys with wrangler. Same account, same bindings, same object storage you’re already paying for.

When you need more than a Worker

Worker ducklings have a ~64 MB envelope. That’s plenty for embedded analytics at SF0.1 / ~1M-row scale. When queries outgrow it, you graduate compute — not the dataset. See Scaling.

Sweet spot

  • Embedded per-tenant analytics in a SaaS on Cloudflare
  • Bursty orgs, mostly idle
  • Parquet lakes up to Worker working-set size
  • Teams who want MotherDuck-shaped tenancy without a second vendor

Pick your lane

If you need…Use
CF-native, scale-to-zero, DIY lakerubberduck
Managed ducklings, IAM, SLAMotherDuck
Firehose ingest, multi-TB warm scansClickHouse

Scales to zero. 25× faster than D1 on groupbys. No need to go to another provider.