Edge computing
A user in Sydney, a server in Frankfurt, and 16,500 km between them. See what distance costs, how running code near the user removes it, and what the edge cannot do.
In 30 seconds
Edge computing means running code on small server sites spread across many cities, close to users, instead of only in one distant data centre.
The gain is latency. Signals need time to cross the planet, and a page load needs several round trips, so answering from 100 km away instead of 16,500 km turns half a second into a few milliseconds.
The price: edge sites are small, and your data usually lives elsewhere. The edge suits quick, light work; shared data and heavy jobs stay at the origin.
Edge computing, step by step
Travel times use the straight-line distance and ignore processing, so real figures are higher. “Edge” also covers devices and gateways on site, such as in factories, not only provider sites.
- Step 1: Far away is slow. A user in Sydney opens a site whose only server, the origin, is in Frankfurt, 16,500 km away. Signals in glass fibre cover about 200 km per millisecond, so a question and its answer need at least 165 ms just to travel. No faster server can shrink that. Only a shorter distance can.
- Step 2: Round trips add up. Loading a page is not one exchange. The browser first opens a connection, then sets up encryption, then asks for the page: three round trips before anything arrives. At 165 ms each, half a second is gone before the first byte of the page shows up.
- Step 3: Move the server closer. Edge computing puts small server sites in many cities, close to where users are, in front of the far-away origin. If the nearest site is 100 km from the user, a round trip takes about 1 ms and the three trips together take 3 ms instead of 495.
- Step 4: Edge functions. An edge site can do more than hand out stored copies of files. An edge function is a small piece of your own code, copied to every site and run there on each request. This one picks the Australian version of a page and answers from 100 km away, without asking the origin at all.
- Step 5: Limit: the data is far. Speed lasts only while the function needs nothing from far away. The shopping cart lives in the database at the origin, so reading it costs the long trip again. Copying data to every site helps, but copies cannot all change at the same instant, so some sites briefly show an old value.
- Step 6: Limit: small machines. An edge site is small and shared by thousands of customers’ functions, so each one gets a thin slice: often around 128 MB of memory, a cap on processor time per request, and a start-up measured in milliseconds. Exact limits vary by provider. Long or heavy jobs still belong at the origin.
- Step 7: What goes where. Work that is quick and needs little shared data suits the edge: serving cached pages and video, redirects, checking login tokens, blocking bots, or a factory gateway reacting to a sensor on the spot. Orders, payments and heavy computing stay at the origin. Most systems use both.
Try it yourself
Learn this first
- Latency vs bandwidth vs throughputThree numbers that describe a connection, and why a fast one can still feel slow. Beginner
- Cloud computing (IaaS, PaaS, SaaS)Renting computers instead of owning them, and who runs which layer in IaaS, PaaS and SaaS. Beginner
- Caching layersCopies kept in the browser, CDN, app and database, and when they go stale. Beginner
Learn next
- AnycastOne address announced from many places; routing picks the nearest. Intermediate
- Consistency models (strong vs eventual)What a read may return after a write when the data lives on three machines. Intermediate
- Multi-cloud vs hybrid cloudSeveral public clouds, or your own servers plus a cloud: what each buys and costs. Beginner
Spotted a mistake on this page?