One server has a limit, and one server is one thing that can fail. Two ways to grow:
| Scaling up | Scaling out | |
|---|---|---|
| How | a bigger instance type | more servers |
| Limit | the biggest type | almost none |
| One fails? | the site is down | the others carry on |
Scaling out needs two pieces:
A load balancer (an Application Load Balancer, for websites) has one address and spreads visitors across the servers in its target group. Every few seconds it runs a health check, asking each server for a page; a server that stops answering gets no more visitors.
An Auto Scaling group keeps a number of servers running, between a minimum and a maximum, across two zones. It launches them from a launch template: a saved recipe of AMI, instance type, security group and user data, as in Chapter 4. A broken server is replaced. With a scaling policy, such as "keep average CPU near 50%", the group adds servers on a busy day and removes them when it is quiet, so you pay only for what the day needs.