Edge-First Architecture

Stu Kennedy  ยท  May 2026  ยท  CloudflareEdgeWorkersSQLite

Forget regions. Forget availability zones. Run your code, your data, and your state within 50 milliseconds of every human on the planet.

The Old World

A user in Edinburgh hits your app. The request travels to London (your AWS region). Your ECS container wakes up. It queries RDS. It caches in ElastiCache. It returns JSON. The browser boots React, parses it, diffs the virtual DOM, patches the real DOM. Total time: 800ms for a "hello world."

The fundamental insight: Cloudflare has ~330 data centres worldwide. Every single one can run your code. Every single one can run SQLite. The "edge" isn't a concept โ€” it's a physically distributed computer the size of the planet.

The Stack

โšก

Workers

Your code. V8 isolates, not containers. Cold start <5ms. Runs in every PoP globally.

๐Ÿ—„๏ธ

D1

SQLite at the edge. Read-optimized replicas in every PoP. Full SQL, not a NoSQL subset.

๐Ÿ”’

Durable Objects

Stateful singletons with their own SQLite database. WebSocket sessions, agent state, real-time coordination.

๐Ÿ“ฆ

R2

S3-compatible storage. Zero egress fees. Store once, serve from the edge.

๐Ÿค–

Workers AI

Run ML models at the edge. LLMs, embeddings, image classification โ€” same V8 isolate as your app code.

The Cost Advantage

ComponentAWSCloudflare
ComputeEC2: $15/moWorkers: $0 (free tier)
DatabaseRDS: $15/moD1: $0 (free tier)
CDNCloudFront: $5โ€“50/moBuilt in
StorageS3: $0.23/GB + egressR2: $0.015/GB, zero egress
Total~$50โ€“100/mo~$0โ€“5/mo

Further Reading