Scaling Out, Not Up
There are two ways to give a system more capacity: make the one machine you have bigger, or add more machines beside it. The first is vertical scaling. The second is horizontal scaling. They sound like a minor implementation detail, but the choice between them decides whether your system survives losing a server at all.
Vertical Scaling: A Ceiling You Will Hit
Vertical scaling, adding more CPU, memory or faster disks to the one server you already have, is the simplest possible way to buy more capacity: no new architecture, no coordination between machines. It has two hard limits:
- A hardware ceiling. You eventually run out of bigger hardware to buy, or hit a price point where the next tier costs disproportionately more.
- A single point of failure. A bigger machine is still one machine. If it fails, everything on it goes down at once.
Key Takeaway Vertical scaling makes your one point of failure more capable. It does not remove it.
Horizontal Scaling: Statelessness Is the Price of Entry
Horizontal scaling adds more machines running identical copies of your application, with a load balancer in front deciding which replica handles each request (the exact mechanism from Module 1). The payoff is real: capacity grows by adding machines, and losing any single one costs you a fraction of total capacity, not the whole service.
The price of entry is that your application servers must be stateless: nothing that matters can live only in one replica's memory, because the load balancer will send the next request from the same user to a different replica with no memory of the first one.
- Session data, in-progress uploads, anything that needs to survive between requests, has to live somewhere every replica can reach: your cache or database layer.
- It cannot live in a variable on one machine.
Load Shedding as a Forcing Function
This is where South Africa's own availability problem becomes a genuinely useful teacher. A load-shedding stage does not ask your architecture's permission before cutting power to a rack. What happens next depends entirely on which of the two designs above you built:
| Stateless replicas behind a load balancer | One server holding session state | |
|---|---|---|
| When the rack loses power | Health checks notice the replica stopped responding | The in-memory state goes down with the rack |
| What the system does | Traffic shifts to the surviving replicas automatically | Nothing to shift to, the state existed nowhere else |
| What the user experiences | Nothing. The next request just lands elsewhere | Logged out mid-task, no matter how good the generator backup is |
Key Takeaway Horizontal scaling does not prevent the power cut. It decides whether the power cut is a non-event or an incident.