Chapter 14. Scaling up and down: auto-scaling and CloudWatch
This chapter covers
- Creating an auto-scaling group with launch configuration
- Using auto-scaling to adapt the number of virtual servers
- Scaling a synchronous decoupled app behind an ELB
- Scaling an asynchronous decoupled app using SQS
- Using CloudWatch alarms to modify an auto-scaling group
Suppose you’re organizing a party to celebrate your birthday. How much food and drink do you need to buy? Calculating the right numbers for your shopping list is difficult:
- How many people will actually attend? You received several confirmations, but some guests will need to cancel at short notice or show up without letting you know in advance, so the number of guests is vague.
- How much will your guests eat and drink? Will it be a hot day, with everybody drinking a lot? Will your guests be hungry? You need to guess the demand for food and drink based on experiences from previous parties.
Solving the equation is a challenge because there are many unknown factors. Behaving as a good host, you’ll order more food and drink than needed to have a solid buffer, and no guest will be hungry or thirsty for long.
Planning to meet future demands is nearly impossible. To prevent a supply gap, you need to add extra capacity on top of the planned demand to prevent running short of resources.