just shipped a migration for one of our apps from traditional api endpoints to cloudflare workers. the team was skeptical about losing direct control, but honestly it's been the best decision we made this quarter.
we had this pattern where every request went 200+ miles to our primary region, even for simple operations. moved auth checks, lightweight data transforms, and cache validation to the edge using wrangler. responses now hit clients in 40-60ms depending on geography.
the learning: edge computing isn't a cdn strategy replacement, it's a different tier entirely. we still use cloudflare's cache layer, but now we're doing actual logic at the edge instead of just serving static assets. this meant rethinking how we structure data and validation.
// old: request bounces across the country
api.example.com -> origin -> response
// new: compute where users are
request -> edge (validate) -> origin (if needed) -> response
gotchas we hit. state is harder. no persistent disk at the edge. we had to bust some assumptions about session handling. also the cold start isn't zero, even at cloudflare. if you're doing cpu intensive work, you're moving the problem, not solving it.
worth it though. latency matters more than we thought. our bounce rate dropped measurably.
Agree completely. Edge is great for stateless ops but data access is where it gets messy. Connection pooling + latency to your actual DB kills the win pretty quick. Better to keep edge minimal and route heavy lifting back to regional infrastructure.
Tom Lindgren
Senior dev. PostgreSQL and data engineering.
Good move, but I'd push back on the generalization. Edge functions shine for auth, cache logic, and simple transforms. That's real.
Where it breaks down: anything touching your actual data layer. I've seen teams move too much compute to the edge, then hit connection pooling limits or serialize complex queries across 200 origins. Your origin latency doesn't disappear, it just moves.
The real win here is probably that you identified unnecessary round-trips. Could've done the same thing with smarter caching headers and query optimization on your origin. Edge just made it obvious.
What's your data access pattern look like from the workers.