Scale up or scale out
Step 1 · The pattern
One server, getting busy
One server handles everything: about 5 requests a second at most, and traffic is now 4 a second. It is 80% busy and the queue is starting to grow. The shop is growing, so something has to change. (All numbers are illustrative.)
- a request
- served
In short
Scale up or scale out: how it works and how it breaks
When one server gets busy there are two ways to grow. Scaling up means a bigger machine: more CPU and memory, no change to the code, and it works until you reach the largest machine you can buy. Scaling out means more machines of the same size behind a load balancer. The difference shows up when something fails. When the one bigger machine crashes, restarts for a patch or is resized, every request fails until it is back. Several smaller servers share the work, and a load balancer with health checks stops sending to one that is down while the others carry the load, as long as each has headroom to spare. Scaling out asks something of the application in return: any server must be able to handle any request, so sessions and other state belong in a shared store, not in one server's memory.
What this simulation simplifies
- A restart takes five seconds here; real machines take seconds to minutes, and resizes often longer.
- The bigger machine is shown as twice as fast per request; real gains depend on whether the work can use more cores.
- The health check reacts at once here, so only requests already in flight fail; real checks need a few failed probes to remove a server, and more requests fail in that window.
How this comes up in interviews
"Your single API server is at 80% CPU. Would you scale up or scale out, and what changes either way?"
Then they ask
- What has to be true of the app before you can scale out?
- How many servers do you need to survive losing one?
- What stays hard to scale out?
A strong answer covers
- Scaling up is quick and needs no code change, but keeps a single point of failure and hits a ceiling.
- Scaling out needs stateless servers: sessions and state in a shared store.
- A load balancer with health checks routes around a failed server.
- Size for N+1: the rest must carry the load after one fails.
- Write-heavy databases are the classic part that scales up first, then shards.
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.
Sources: AWS Well-Architected Framework, Reliability pillar: Design principles ↗ · Microsoft Azure Architecture Center: Design to scale out ↗ · Report a problem
Diagrams are our own simulations: the timings, rates and counts in them are illustrative, not measurements. Captions are original wording.