Skip to content

DNS / HTTP · 9 of 9

Edge compute: data left behind

Step 1 · The pattern

The edge serves what it can, the region does the rest

A user in Sydney hits the edge nearby. It serves cached pages and checks tokens itself, and passes anything that needs data to the app in Virginia, which sits next to the database and makes its 4 queries in milliseconds. One long trip, then local work. (All numbers are illustrative.)

  • a page request
  • page in time

In short

Edge compute: data left behind: how it works and how it breaks

Edge platforms (Cloudflare Workers and similar) run your code in hundreds of data centres, each request handled close to the user. For work that needs nothing else, such as redirects, auth checks on signed tokens, header rewrites or cached pages, that saves a long trip and feels instant. Most application logic needs data, and the database usually lives in one region. Code at the edge then crosses the world once per query: a page that makes four queries in a row from Sydney to a database in Virginia pays four long round trips, and ends up slower than if the whole thing ran next to the database. Decide by where the data is: keep the edge for work that needs no data or only cached or replicated data, run data-heavy logic in the database's region (some platforms place it there automatically), or bring the data closer with replicas and caches.

What this simulation simplifies

  • Distances are compressed: real cross-world round trips are around 200 ms, not most of a second.
  • Connection reuse and protocol tricks that shave some time are left out.

How this comes up in interviews

"Should this API run at the edge?"

Then they ask

  1. What does it read and write?
  2. Where is the data?
  3. What about writes?

A strong answer covers

  • Edge wins for work that needs no data, or only cached or replicated data.
  • Each query to a distant database costs a long round trip.
  • Run data-heavy logic in the data's region; some platforms place it automatically.
  • Bring data closer with replicas or caches for read-heavy pages.
  • Stage edge rollouts: a change reaches every location at once.

Points to cover, not a script. Say them in your own words and tie them to a system you have worked on.

On one page: the track cheat sheet.

Last reviewed: Official documentation

Diagrams are our own simulations: the timings, rates and counts in them are illustrative, not measurements. Captions are original wording.