Skip to main content
Glossary

Edge Computing

Processing data closer to where it is generated rather than in a centralized data center, reducing latency and improving performance for end users.

Detailed Explanation

Edge computing runs code at CDN locations worldwide, processing requests at the server closest to the user. Instead of all requests traveling to a central server (potentially thousands of miles away), edge functions execute in under 1 millisecond at the nearest edge node.

Cloudflare Workers, Vercel Edge Functions, and Deno Deploy are popular edge computing platforms. Edge functions are ideal for: authentication/authorization (validate tokens at the edge), A/B testing (route users at the edge), personalization (customize content based on location), API gateways (transform responses at the edge), and static site generation (cache and serve pre-rendered pages).

Why It Matters

Edge computing reduces latency to sub-millisecond levels, enabling faster, more responsive applications for global users.

Real-World Example

A news website uses Cloudflare Workers to personalize content at the edge. When a user in Japan visits, the worker determines their location, language preference, and subscription status—all at the edge—without hitting the origin server.

When to Use

For latency-sensitive operations, authentication, A/B testing, personalization, and API gateway logic. Avoid for operations requiring direct database access or complex computation.

Advantages

  • Sub-millisecond execution at the edge
  • Reduces origin server load
  • Global distribution without infrastructure management
  • Scales automatically with traffic
  • Built-in DDoS protection

Disadvantages

  • Limited runtime (no access to local filesystem)
  • Execution time limits (typically 10-30 seconds)
  • Cold starts (though very fast)
  • Debugging is harder than traditional servers
  • Limited access to databases and storage

Frequently Asked Questions

What is the difference between edge and serverless?

Edge functions run at CDN locations near users (sub-millisecond). Serverless functions run in centralized regions (50-200ms latency). Edge is better for latency-sensitive operations; serverless is better for complex computation.

What can I do at the edge?

Authentication, A/B testing, personalization, API gateways, content transformation, geolocation-based routing, security rules, and caching logic. Avoid: database queries, heavy computation, and file system operations.

Which edge platform should I use?

Cloudflare Workers (most mature, largest network), Vercel Edge Functions (best for Next.js), Deno Deploy (TypeScript-native), or Fastly Compute (highly customizable). Choose based on your stack and requirements.

Do edge functions have access to databases?

Direct database access from the edge is limited due to latency and connection limits. Use edge-compatible databases (Cloudflare D1, Neon, PlanetScale) or cache data at the edge with KV stores.

Is edge computing secure?

Edge functions run in isolated V8 sandboxes with limited permissions. They are as secure as serverless functions. However, ensure sensitive operations (database writes) are protected by authentication and authorization.

Back to Glossary

Browse all terms in our software development glossary.

Browse All Terms