Skip to content
Back to the journal
DevelopmentFIELD NOTES / 51

Edge vs serverless: put the work in the right place

Compare edge and regional serverless architectures by data location, latency, runtime limits, background jobs, and operational complexity for modern websites.

Intersecting orbital rings around an illuminated sphere, illustrating edge computing.
Intersecting orbital rings around an illuminated sphere. Original illustration for the RaagNeet Journal.

Edge and serverless describe different properties. Edge concerns where computation happens; serverless concerns how infrastructure is managed and billed. A service can be both. Choosing a deployment model starts with tracing the request, especially where its data lives and which operations dominate the time a user waits.

01Understand the execution model

Cloudflare Workers is one example of a distributed serverless runtime that uses isolates. Other platforms use different execution and placement models. The architecture determines available APIs, startup characteristics, and how work shares resources, so compare the actual service rather than a generic hosting label. [1]

A public redirect, cache lookup, or lightweight request transformation may fit a distributed runtime well. A task that repeatedly queries one distant database may gain little from running the first line of code close to the user. Trace the whole journey before drawing a conclusion.

02Check the current platform limits

Hosted runtimes set limits for CPU, memory, request size, duration, and other resources. Limits can vary by plan and feature. Read current documentation for the exact deployment target instead of relying on a remembered number from another provider or an older release. [2]

An illustrative image-processing task might need a native dependency unavailable in the selected runtime. A long report job might need a queue and worker rather than a foreground request. Discovering those constraints during architecture selection is much cheaper than discovering them after the application is complete.

An illustrated decision flow: Locate the data → Trace the request → Check runtime limits → Measure latency.
A practical framework: Locate the data → Trace the request → Check runtime limits → Measure latency. This is an illustrative workflow, not a measured benchmark.

03Keep computation near the data it needs

A user in one region can still experience slow responses if the request performs several sequential round trips to a database elsewhere. Consider placing data-heavy operations near the authoritative data source, caching appropriate public responses, and reducing unnecessary network hops.

Do not solve latency by caching private responses without a clear account-aware policy. Cache keys, authentication, and invalidation need to reflect who may receive the result. A fast response served to the wrong person is a correctness and security failure.

04Separate interactive and background work

The operation a visitor waits for may only need to validate an input and acknowledge a queued task. A background worker can then generate a report, send an authorised message, or process an upload. This lets the interface stay responsive without pretending the long operation already finished.

Use stable job identifiers and make retries safe. Provide a status route or notification mechanism appropriate to the product. An accepted job and a completed job are different states, and the interface should communicate that distinction clearly.

05Compare measured behaviour and maintenance

Test representative requests from relevant regions and include database access, cold paths, cache misses, and errors. Compare tail latency as well as average response time. Review observability, local development, deployment recovery, pricing, and the team's ability to maintain the system.

A mixed architecture can be sensible: static content on a CDN, lightweight edge logic, a regional application near its database, and queued background jobs. Choose each component for a specific requirement. Avoid adding distribution simply because it sounds modern; every boundary introduces something to operate and debug.

A LITTLE MORE CLARITY

Common questions

Is edge computing the opposite of serverless?

No. Edge describes placement, while serverless describes an infrastructure model. A distributed edge function can also be serverless.

Will moving every API to the edge make a site faster?

Not necessarily. Database location, sequential network calls, runtime limits, caching, and workload shape all matter. Measure the complete request path.

FOLLOW THE THREAD

Sources & further reading

Primary documentation and further reading are linked below. Examples and decision frameworks are illustrative; product capabilities can change.

  1. Cloudflare: How Workers works
  2. Cloudflare: Workers platform limits

Created with AI assistance for the RaagNeet Journal. This guide does not claim original product testing or benchmark results. Original illustrations by RaagNeet. Send a correction.

edge computingserverlessweb development