Machine Room

Horizontal vs Vertical Scaling

One server can't keep up: make it bigger (scale up) or add more servers (scale out). The one-page notes from the reel.

Download the PDF

One-page notes, Horizontal vs Vertical Scaling. One server can't keep up: a bigger server, or more servers. 1, Two moves. bigger server. more servers. Vertical scaling, also called scaling up: make the one server bigger, with more CPU and more memory. Horizontal scaling, also called scaling out: add more servers of the same size, side by side. 2, Scaling up: one bigger machine. 2 CPU · 8 GiB, 4 CPU · 16 GiB, 8 CPU · 32 GiB, 16 CPU · 64 GiB. stopped. The app doesn't change at all. But the server usually has to be stopped while it's swapped for the bigger one. Each step doubles both CPU and memory (one cloud server family's real sizes). 3, Where scaling up stops. the price climbs fast. size. price. biggest size. ceiling. single point of failure. The price climbs fast as the machine gets bigger. And there is a biggest machine. Past that, there's nothing left to buy. It's still one machine. If it fails, every user is down. That's a single point of failure. 4, Scaling out: the catch, and the fix. the catch. you. load balancer. server 1, server 2, server 3. logged in. who are you?. the fix. load balancer. server 1, server 2, server 3. stateless. shared store. database, cache. You need a load balancer in front, to spread the requests. Say you log in, and server 1 remembers you. Your next request lands on server 2, and it has no idea who you are. So no server can keep a user's data on itself. That data moves to a shared place, like a database or a cache, where every server can read it. A server that keeps nothing of its own is called stateless. 5, Autoscaling. CPU above 70 %: add one. CPU below 50 %: remove one. Once the servers are stateless, any of them can take any request. Add servers while the others keep serving, and remove them when traffic drops. When that happens automatically, it's called autoscaling. The card is Azure's own example rule, on average CPU. 6, Side by side. vertical | horizontal. also called | scaling up | scaling out. the move | one bigger server | more servers, same size. what changes | nothing in the app | a load balancer, no user data on the servers. while it changes | usually stopped | the others keep serving. how far | a biggest size | keeps growing. Vertical is the quick fix, but it has a ceiling. Once your servers are stateless, scale horizontally.

On a phone, press and hold the image to save it.