SYSTEMS ONLINE|EDGE: 14ms
~/tq / 2026 / De-Clouding to the Edge: Architectural Migration from Vercel/Neon to Cloudflare Workers & D1

De-Clouding to the Edge: Architectural Migration from Vercel/Neon to Cloudflare Workers & D1

How we decommissioned our centralized US-East Postgres cluster and Node.js serverless tier, eradicated $4,200/mo in transit egress, suppressed p99 tail latency from 340ms to 18ms, and replicated SQLite primitives across 310+ edge locations.

-87%
CLOUD EGRESS & COMPUTE
18ms
P99 GLOBAL TTFB
0ms
COLD START OVERHEAD
$0.00
ZERO EGRESS BILLING

The Hidden Tax of Centralized Serverless

In 2024, our SaaS platform processed 42 million synthetic API operations per day. The stack seemed modern on paper: Next.js edge functions on Vercel paired with a managed serverless Postgres provider (Neon) deployed in us-east-1.

However, physics is relentless. A client hitting our edge endpoint in Tokyo or Frankfurt experienced an unavoidable 180ms to 240ms round-trip speed-of-light tax to Northern Virginia simply to serialize state queries. Worse, whenever containers scaled to zero during lulls, AWS MicroVM spin-ups added cold start penalties of up to 1.8 seconds.

System Topology

[ARCH A: CENTRALIZED AWS/VERCEL]
  Client (EU/APAC) ──[160ms transit]──> Vercel Gateway ──[Cold Start + TCP]──> Neon Postgres (us-east-1)
  ROUNDTRIP: 280ms - 420ms (Cross-AZ traffic fee: $4,850/mo)

[ARCH B: CLOUDFLARE EDGE FABRIC]
  Client (Anywhere) ──[<10ms Anycast]──> CF Worker V8 ──[Memory Bus]──> D1 SQLite Replica (Local PoP)
  ROUNDTRIP: 12ms - 22ms ($0 transit egress)

Trade-Off Verdict: Centralized serverless providers mask transit egress costs behind seamless DX. Once our write volume surpassed 30GB daily egress between Lambda edge nodes and managed Postgres, cross-AZ traffic fees consumed 44% of our gross cloud invoice.

Astro Middleware & Cloudflare Worker Binding

By switching our primary runtime to Astro SSR on Cloudflare Workers, we bypassed Node runtime overhead completely. We bind D1 SQLite databases directly into the Worker execution context through zero-overhead IPC.