Two years ago, every product I built followed the same pattern: a VPS running a Node.js server, a PostgreSQL database, and an S3 bucket for files. It worked, but it was expensive and complex.
Then I discovered Cloudflare's edge platform. Today, all my products run on Cloudflare Workers with D1 databases and R2 storage. Here's why the switch was transformative.
The Old Stack
| Component | Old | New |
|---|---|---|
| Compute | VPS ($20/mo) | Workers ($5/mo) |
| Database | PostgreSQL ($15/mo) | D1 (included) |
| Storage | S3 ($5/mo) | R2 (zero egress) |
| CDN | Cloudflare ($0) | Cloudflare (built-in) |
| Total | $40/mo | $5/mo |
Why Edge Wins
Speed
Cloudflare has 300+ data centers worldwide. Your code runs at the edge, closest to the user. A request from Tokyo hits a Tokyo server — no cross-continent latency.
Simplicity
No servers to manage. No OS updates. No security patches. No load balancers. You write JavaScript/TypeScript and deploy it. That's it.
SQLite at the Edge
Cloudflare D1 brings SQLite to the edge. For most applications, SQLite is more than enough — and it's dramatically simpler than PostgreSQL:
// D1 query in a Worker
const result = await env.DB.prepare(
'SELECT * FROM users WHERE id = ?'
).bind(userId).all();
Zero Egress Fees
R2 storage is S3-compatible with zero egress fees. Serving 100GB of data costs nothing. With S3, that same traffic would cost ~$9.
When Edge Isn't Enough
Edge-first doesn't mean edge-only. For long-running tasks (video processing, ML inference), I still use traditional servers. But for the 90% of web apps that are CRUD + API, edge is the answer.
The best architecture is the simplest one that works. Edge-first eliminated 80% of my infrastructure complexity while cutting costs by 87%.
The Migration Path
You don't need to rewrite everything. Start with your static assets on Pages, then move your API to Workers, then your database to D1. Each step is independent and reversible.