Purpose

Implement chunked R2-based database export to support any database size (up to 10GB). Uses DO alarms for exports exceeding the 30-second Worker timeout, with breathing intervals to prevent database lock contention. Includes callback URL notifications and new status/download endpoints.

/claim #59

Tasks

  • Replace in-memory dump with batched R2 chunked export (1000 rows/batch)
  • Implement DO alarm continuation for long-running exports
  • Add breathing intervals (2s) between alarm cycles
  • Add POST /export/dump with optional callbackUrl param
  • Add GET /export/status/:exportId endpoint
  • Add GET /export/download/:exportId endpoint
  • Add R2 bucket binding to wrangler.toml
  • Backwards compatible fallback when R2 is not configured
  • Comprehensive test suite (15 tests)

Verify

  1. Run pnpm vitest run src/export/chunked-dump.test.ts — 15 tests should pass
  2. Run pnpm vitest run — all 166 existing tests still pass
  3. Configure R2 bucket, deploy, and hit GET /export/dump on a small DB — should return .sql file directly
  4. Hit POST /export/dump?callbackUrl=https://example.com on a large DB — should return 202 with exportId
  5. Poll GET /export/status/:exportId — should show progress
  6. After completion, GET /export/download/:exportId — should return the .sql file

Before

Screenshot 2026-03-02 200224 image

After

image

#Short Demo video of changes

https://github.com/user-attachments/assets/7f237412-cba7-4fd5-8832-e29216dd266e

Claim

Total prize pool $250
Total paid $0
Status Pending
Submitted March 02, 2026
Last updated March 02, 2026

Contributors

UT

Utkarsh Gupta

@scrollingreel

100%

Sponsors

OU

Outerbase (YC W23)

@outerbase

$250