Cloudflare Workers + D1 + R2: Zero-Egress Stack Cost
Estimate a zero-egress serverless stack on Cloudflare Workers Paid, D1, and R2 from 1k to 100k monthly active users.
Stack Cost Summary: Cloudflare Workers Paid ($5/mo), D1 (25B rows read included), and R2 ($0 egress) eliminate bandwidth spike bills, leaving D1 row-scan volume as the main scaling watchpoint.
Estimate my stack cost
Verified catalog rates as of 2026-12-01 00:01 UTC.
Pro engineering assumptions
Purple line: your stack. Green line: flat-rate swap. Dashed line: your current users.
Billing cliff alerts
Amber cards show a price jump your current inputs have already crossed.
Watch · D1 row-scan explosion
50M rows read/mo, under 25B included. Unindexed queries multiply this.
Your 6-layer stack
Change any layer to see the bill move. The flat-rate swap uses the same sliders and assumes one VPS; capacity limits and migration effort are not modelled.
| Layer | Your option | Monthly | Flat-rate swap |
|---|---|---|---|
| 1 · Build | $0/mo | Open-source CLI$0/mo | |
| 2 · Compute | $5/mo | Flat VPS + Coolify$4.59/mo | |
| 3 · Database | $0/mo | Postgres on VPS$0/mo | |
| 4 · Auth | $0/mo | Better Auth (OSS)$0/mo | |
| 5 · Storage & CDN | $1.35/mo | Cloudflare R2$1.35/mo | |
| 6 · AI runtime | $477/mo | OpenRouter hybrid$477/mo | |
| Ops time (Pro) | 4 h/mo on self-hosted VPS | $0/mo | Swap: $0/mo |
| Total (tracked) | $483/mo | Swap: $483/mo |
Cost at 0 / 1k / 10k / 50k / 100k users
Dollars per month. Traffic and AI usage scale in proportion to your current sliders. Small figure under the swap cost: how much more (+) or less (−) your stack costs.
| Users | Your stack | Flat swap |
|---|---|---|
| 0 users | $5 | $4.59+$0.41 |
| 1,000 | $52.70 | $52.29+$0.41 |
| 10,000 | $483 | $483+$0.41 |
| 50,000 | $2,397 | $2,397+$0.41 |
| 100,000 | $4,790 | $4,789+$0.41 |
Zero-egress architecture without viral bandwidth anxiety
For solo builders serving media-heavy apps, global APIs, or high-traffic dashboards, bandwidth egress is usually the scariest line item. On Cloudflare Workers Paid ($5/mo base) paired with R2 object storage ($0.015/GB-month after 10 GB free and $0.00 egress), a 10× traffic spike does not trigger a surprise $0.09/GB or $0.15/GB bandwidth invoice.
The subtle cliff to watch on Cloudflare D1 is row-scan volume. Workers Paid includes 25 billion rows read per month, with overages billed at $0.001 per million extra rows read. Well-indexed point lookups stay far below 25B rows even at 50k+ MAU, but an unindexed full-table scan inside a hot endpoint (use the DB rows read per request input in the Pro drawer) can multiply row reads by 100×. Pairing Workers with Hyperdrive + external Postgres avoids row-read billing entirely for scan-heavy analytics.
When this stack wins
- Media & asset-heavy SaaS: R2 removes egress anxiety at 1 TB–20 TB/mo.
- Predictable base floor: $5/mo Workers Paid + $0 Better Auth OSS keeps fixed overhead near zero.
- Related guides: compare object storage rates in Zero-Egress Storage Deals and S3 vs R2 Viral Egress.