# Scalability

> How well a system keeps working when it has to handle much more.

- Level: Basic
- Topics: Cloud
- URL: https://tidbit.legios.com.ar/scalability/
- In Spanish: [Escalabilidad](https://tidbit.legios.com.ar/es/scalability/)

**Scalability** is the ability of a system to handle more work, more users, more data, more requests, by adding resources, without being redesigned from scratch. An online shop that runs fine with a hundred visitors and also with a hundred thousand, just by adding machines, is scalable. One that slows to a crawl and needs a rewrite is not.

There are two basic ways to grow. **Vertical scaling** (scaling up) means a bigger machine: more CPU, more RAM. It is simple but has a ceiling and a single point of failure. **Horizontal scaling** (scaling out) means more machines of the same size working side by side, with a load balancer spreading the traffic. It has almost no ceiling, but the software must be built so any copy can answer any request.

The cloud made horizontal scaling cheap and quick: you can rent ten more servers in minutes and give them back tomorrow. That is why scalability is now a design question more than a hardware one. The parts that scale worst are usually the ones that share state, like a single database everyone writes to.

## An analogy

A bakery that gets popular. It can buy a bigger oven (vertical) or open more branches with the same oven (horizontal). The bigger oven is easier but there is only so big an oven can get.

## Keep in mind

- Scalable means more load can be handled by adding resources, not by rebuilding.
- Vertical: a bigger machine. Horizontal: more machines.
- Horizontal scaling needs apps where any copy can serve any request.
- Shared state, often the database, is the usual bottleneck.

## Go deeper

- [Scalability on Wikipedia](https://en.wikipedia.org/wiki/Scalability)

## Related terms

- [CPU](https://tidbit.legios.com.ar/cpu/): The chip that runs your programs, one instruction after another, very fast.
- [RAM](https://tidbit.legios.com.ar/ram/): The computer's short-term memory: fast, small and wiped when you turn it off.
- [High availability](https://tidbit.legios.com.ar/high-availability/): Designing a system so it keeps working when one of its parts fails.
- [Load balancer](https://tidbit.legios.com.ar/load-balancer/): The traffic cop that spreads incoming requests across many servers.
- [Cloud computing](https://tidbit.legios.com.ar/cloud-computing/): Renting computers over the internet instead of buying your own.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
- [Database](https://tidbit.legios.com.ar/database/): An organized store of data that programs can search and update safely.
