Skip to main content
株式会社オブライト

Articles tagged "D1"

1 article

Software Development2026-07-06
"Stop Overcomplicating Your Stack, Just Deploy Everything to Cloudflare" — Fact-Checking @ibocodes' Viral $5/Month Post: Workers + D1 + KV + R2 + Queues + Hyperdrive + Email Routing + WAF/DDoS Built-In How Better Auth Fits, Where Durable Objects Belong, and How Flue Framework Rounds It Out
**@ibocodes' X post — "my entire 2026 stack runs on cloudflare and I pay $5/month" — went viral** ([original tweet](https://x.com/ibocodes/status/2071238084922917082)). The claim: **Workers (compute) + D1 (SQL DB) + Better Auth + KV (cache) + R2 (object storage) + Queues (background jobs) + Hyperdrive (DB acceleration) + Email Routing (sending) + built-in WAF / DDoS** — all on a $5/month floor, capped around $10 in the worst case. This column **fact-checks that claim against Cloudflare's published pricing**, walks through each of the eight services, calls out real-world cost inflection points, covers the Better Auth integration pattern, and situates the stack next to our prior [Cloudflare Durable Objects](../columns/cloudflare-durable-objects-2026-07) and [Flue Framework](../columns/flue-framework-astro-team-agent-2026-07) columns. **Real pricing structure**: the Workers **Paid plan is a $5/month floor** and covers Workers itself + KV + Hyperdrive + some Durable Objects usage. D1, R2, and Queues layer on with **generous free tiers plus usage-based billing**. **For a solo SaaS in its early stage, $5–10/month really is enough**, but at production scale (DB reads, R2 storage, Queue messages) bills commonly stretch to **$30–100/month**. **Better Auth × D1**: [zpg6/better-auth-cloudflare](https://github.com/zpg6/better-auth-cloudflare) provides a CLI that auto-provisions **Workers + D1 + Hyperdrive + KV + R2 + geolocation** end-to-end. Both Drizzle ORM and native D1 are supported, with guides for Hono / Next.js / React Router / SvelteKit. **The critical implementation pattern**: create a Better Auth instance **per request** (never a shared singleton) so the D1 binding for that request is injected correctly. Note also **Better Auth's session-refresh bug #4203**, which was reopened in January 2026. **The eight services**: - **Workers** — global serverless compute with near-zero cold-start - **D1** — distributed SQLite-based SQL DB with scale-to-zero billing - **KV** — eventually-consistent key-value store (read-heavy, edge-cache use) - **R2** — S3-compatible object storage with **zero egress cost** - **Queues** — message queue with **no egress fees** and at-least-once delivery - **Hyperdrive** — connection pooling and edge caching for external Postgres / MySQL, available even on the Workers Free plan - **Email Routing** — transactional email sending via Workers bindings or REST API - **WAF & DDoS** — included in every plan, with industry-leading DDoS protection **Natural companions**: pair with [Durable Objects](../columns/cloudflare-durable-objects-2026-07) for strong-consistency state + WebSockets, and [Flue Framework](../columns/flue-framework-astro-team-agent-2026-07) for the AI-agent layer — the **all-Cloudflare distributed system** is genuinely deployable end-to-end. **Caveats**: single-vendor lock-in (AWS / GCP migration costs), **CPU-heavy work is a bad fit for Workers** (AI inference and heavy image processing need Cloudflare AI or external GPU), **D1's write-throughput ceiling** (high-write workloads belong on Durable Objects), and **Better Auth's rough edges** (the session bug and a few other issues). Even so, the honest conclusion is that **the era where 90% of individual / startup / mid-market SaaS runs entirely on Cloudflare has arrived**.
CloudflareWorkersD1