Every performance conversation eventually arrives at the same uncomfortable truth: the speed of light is not negotiable. A request from Sydney to a server in Virginia pays a round-trip tax no amount of code optimization can refund. For years we treated that tax as fixed overhead. Edge computing reframes it as a design decision.
This article documents a real migration — a dashboard-heavy SaaS moving its request path from a single-region serverless stack to edge functions — including the three dead ends we hit before the architecture settled.
The anatomy of a slow request
Profiling showed our median request spent 38% of its life in transit, 22% waiting on a cold Lambda, and only 19% doing useful work. The remaining time was serialization and a database handshake that happened on every invocation because connections could not be pooled across cold starts.
The instinct is to attack the biggest slice first, but transit time and cold starts are coupled: moving compute closer to users without rethinking state just relocates the wait. The database was still in Virginia. Our first edge deployment made TTFB better and total latency worse — the edge function made four sequential round-trips to a distant Postgres.
Where a slow request spent its time
Median request, profiled before the edge migration
What actually worked
The architecture that survived has three layers: edge functions handle auth, routing, and cached reads; a regional core owns transactions and anything requiring strong consistency; and a replicated read layer (we used read replicas plus KV caching) feeds the edge. The rule that kept us honest: an edge function may make at most one round-trip to the region per request.
Latency budgets became part of code review. Every new endpoint declares its budget in milliseconds, and CI fails if the synthetic probe exceeds it from any of five test regions. That single practice — making latency a reviewed artifact rather than a dashboard surprise — mattered more than any individual optimization.
Takeaways
Edge compute is not a faster server; it is a different topology. Treat state placement as the primary design question, cap region round-trips per request, and turn latency into a budget your CI enforces. The speed of light stays undefeated — but you can stop paying it interest.