Glossary · devops
Edge Function
Definition
An edge function is a serverless function that runs on the CDN node closest to the user. Instead of a single server (us-east-1), it runs in 100+ global locations — latency drops from 200ms to 20ms. Vercel Edge, Cloudflare Workers, AWS Lambda@Edge, Deno Deploy are the leading platforms.
Detailed explanation
Traditional: user (Istanbul) → backend (us-east-1) → 200ms RTT. Edge: user → nearest edge node (Frankfurt, 30ms) → 20-50ms total.
2026 platforms: Vercel Edge (Next.js native, V8 isolates), Cloudflare Workers (V8 isolates, 270+ locations), Deno Deploy (TypeScript native), AWS Lambda@Edge (CloudFront-integrated).
Limits: bundle <1 MB, 50ms CPU, no native Node.js modules (only Web APIs), no filesystem, DB connection pooling is hard (D1, Turso are edge-friendly).
Use cases: auth/redirect (Next.js middleware), A/B testing, geo-routing, image optimization, AI inference (small models), real-time analytics, KV/cache.
Use cases
→Auth middleware (start of every request)
→A/B test routing
→Geographic redirect
→Image optimization on-the-fly
→Edge cache (1-100ms response)
→AI inference (lightweight)
Pros
- +Latency drops 5-10x
- +Cold start <1ms (V8 isolates)
- +Automatic global distribution
- +Pay-per-use (idle = 0 cost)
Cons
- −Bundle-size limit (1 MB)
- −CPU time limit (50ms)
- −No native Node.js modules
- −DB connection pooling tricky
Related terms
Related services
Planning a project around Edge Function?
In a 30-minute discovery call we share a written architecture + cost + team recommendation tailored to your project.
Start a discovery call