What is scaling? Explained with checkout lanes at rush hour
Scaling is how a website copes with more users: a bigger server, or more copies side by side that come and go with demand. Explained with a supermarket opening extra checkout lanes at rush hour.
- Author
Umair Mateen- Published
- Updated
- Reading time
- 5 min
- Category
- DevOps
In one sentence: Scaling is how a website or app handles more users without slowing down: you either give it a bigger, faster computer (scaling up) or add more copies of it side by side (scaling out), and, ideally, remove them again when things go quiet.
The everyday picture
Picture a supermarket on a Saturday afternoon. Most of the week, three checkout lanes are enough. Then the rush hits. Queues grow, shoppers get annoyed, and some leave their baskets and walk out.
The shop has two choices. It can make one lane faster, with a quicker scanner and a more experienced cashier. Or it can open more lanes. A good shop also has a manager who watches the queues, calls staff to open lanes when they grow, and sends them back to other work when the rush ends.
A website works the same way. Each "lane" is a server, a computer that answers visitors' requests. Scaling is deciding how many lanes to run, and how fast each one is.
A guide (the load balancer) sends shoppers to open lanes. The manager (the autoscaler) watches the queues, opens extra lanes in a rush and closes them when it ends.
How it works, step by step
- Scaling up, or vertical scaling (a faster lane). You move the app to a bigger computer with more processing power or memory. It is simple, but the lane often has to close briefly while the change happens, and there is only so fast one lane can go.
- Scaling out, or horizontal scaling (opening more lanes). You run several identical copies of the app, each called an instance. The lanes already open keep serving while new ones get ready.
- Something spreads the traffic (a guide pointing shoppers to the shortest queue). This is usually a load balancer, which sends each visitor's request to a copy that has room.
- Autoscaling watches and reacts (the manager watching the queues). It follows signals such as how busy the processors are, how long replies take, or how many jobs are waiting. When a set limit is crossed, it adds copies. When demand drops, it removes them, which is called scaling in.
- Limits keep it sensible (the manager knows the fewest and most lanes the shop can run). Teams set a minimum and a maximum number of copies, and a short pause between changes so the numbers can settle before the next decision.
Try it · Try the dial
Turn up the rush and watch the lanes
Drag the dial and watch what changes.
Quiet. Only the minimum number of lanes stays open. Slide back here after a rush and the extra lanes close again: that is scaling in.
Where the picture stops
- New lanes are not instant. A new server copy has to start up and load the app before it can help, and that takes time. Good setups keep a little spare room so the queue does not overflow while it gets ready.
- Any lane must serve any shopper. In a shop that is normal. In software, a copy that keeps a visitor's details only in its own memory breaks this. Apps meant to scale out keep that information in a shared place, so any copy can pick up any request. Engineers call this being stateless.
- More lanes will not fix a slow card machine. If every lane waits on one shared system, such as the database where records are kept, adding lanes just makes a longer queue there. Databases usually need their own scaling plan.
Why it matters for your business
- Customers stay during busy times. A sale, a launch or a mention in the news can bring a rush. An app that scales keeps pages loading instead of timing out.
- You pay closer to what you use. Removing copies when traffic is low cuts the bill, instead of paying for rush-hour capacity all week.
- Fewer single points of failure. With several copies running, one can fail and the others keep serving.
- It has to be designed in. Microsoft's architecture guidance advises finding the real bottleneck before adding capacity, and checking that the app can actually run as several copies. A higher maximum alone does not prove the app can cope.
An example
Imagine an online flower shop. Most days, two server copies handle its visitors easily. In the week before Mother's Day, traffic climbs every evening.
Its autoscaling rule is similar to an example in Microsoft's guidance: add a copy when average processor use stays above 70%, and remove one when it falls below 50%. The gap between the two numbers stops it switching copies on and off constantly. It also has a maximum of eight copies, so a sudden spike cannot run up an unlimited bill.
Before the busy week, the team checks the shared database can handle the extra orders, since every copy depends on it. After the holiday, the copies drop back to two on their own.
Frequently asked questions
What is the difference between scaling up and scaling out?
Scaling up means a bigger, more powerful single server. Scaling out means more servers running the same app side by side. Scaling out can grow further and usually avoids downtime, but the app must be built to run as several copies.
What is autoscaling?
Autoscaling is when the hosting platform adds or removes server copies automatically, based on rules you set, such as processor use, response time or queue length. You also set the smallest and largest number of copies allowed.
Does scaling make my app faster?
It stops the app slowing down when many people use it at once. It does not fix slow code or a slow database. If one part is the bottleneck, that part needs attention first.
Do small businesses need to think about scaling?
If your traffic is steady and low, a single server may be fine. It matters more if you have busy seasons, campaigns or sudden spikes, or if downtime would cost you sales.
Related explainers
- What is cloud hosting? Explained with a serviced office
- What is caching? Explained with a restaurant kitchen
- Frontend vs backend, explained with a restaurant
- What is an API? Explained with a waiter in a restaurant
The DevDrift sets up cloud hosting that grows and shrinks with demand: see how.
Sources
Could you explain this to a colleague now?
Mark it and posts that mention it will show a tick. Saved in this browser only.