Continue where you left off ×
The stall with no stove: serverless and edge
The Isolate · Open board
The small walled room that Cloudflare gives each customer’s code, so thousands can share one machine. This lesson asks when renting code by the call is the right choice, and when it costs you.
Before you start. Two kitchens, two cities (multi-region and active-active) gave you the region, a cluster of data centers in one part of the world, and the cost of distance between two of them. The chai stall that got famous (load balancing) gave you the server as a stove that can only make so many cups an hour, so you add stoves as the queue grows. The rooms AWS runs for you gave you Lambda, code that AWS runs only while an event needs it, and its limits: 15 minutes a run and nothing kept in memory between runs.
The idea in 30 seconds
A function is code the provider runs only when called, so you pay per call and own no server.
At $3.53 per million 1 GB, 200 ms calls, the break-even against a $30 server is about 3.3 calls a second.
A cold start is the delay before code can run on a machine that is not ready, and it shows up when traffic is thin.
Edge compute runs code near the user, so the cable delay falls from 120 ms to 3 ms in the teaching example.
Isolates make the edge cheap by sharing one program, at the cost of small limits on memory and time.
Serverless wins on spiky, short, independent work and loses on steady, heavy or chatty work.
Read the story
Lesson 28 of 115 in System Design
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year .
See plans Already a member? Sign in
Or start free : a free account opens lessons 2 and 3 of every track.
In this lesson March 2023: a team on Prime Video builds a tool the fast way, and it hits a wall A function: code that runs only when someone calls it Paying by the call: the break-even sum The first call is slow: what a cold start is The edge: running the function near the person When serverless wins, and when it loses Terms it explains: function, cold start, edge compute, "Where does state go?", "Why use the edge?", Common mistakes.
Review System Design
Mark as read Saved in this browser, and to your account when you sign in.