An application scales when its capacity grows and shrinks with demand, that is, with how many people use it at each moment. On the SAA-C03 exam the questions on this topic ask you how to achieve that with Amazon EC2 Auto Scaling and Elastic Load Balancing. To build that answer you choose three things: the policy that decides when the number of instances changes, the measure that drives that policy and the load balancer that sits in front of the instances. For example, an online store needs few instances early on a Tuesday morning and many on the day of a special sale, and without scaling it would overpay on Tuesday or go down during the sale.
Vertical and horizontal scaling
There are two ways to scale an application. Vertical scaling gives more processor or memory to the same instance, like swapping a computer for a more powerful one, while horizontal scaling adds more instances that share the work. For example, the store scales vertically if it swaps its only instance for a larger one, and it scales horizontally if it goes from two identical instances to six.
The AWS compute guide says horizontal scaling is the one you need for dynamic workloads, which are the ones that change a lot during the day, because it grows and shrinks with demand and you pay only for what you use. That is why the exam assumes you scale horizontally, and what it asks is how to do it.
Amazon EC2 Auto Scaling policies

An Auto Scaling group is a set of identical instances that AWS keeps between a minimum and a maximum that you set. The policy is the rule that decides when that number goes up or down, and it is almost always based on a metric. There are five types of policy:
- Target tracking, where you choose a metric and a target value and the group adds or removes instances to keep it close to that value, like a thermostat, and which AWS recommends over the others.
- Step scaling, which makes adjustments of different sizes depending on how far the metric went past the limit you set in an alarm, which is an alert that goes off when the metric crosses that limit.
- Simple scaling, which makes a single adjustment per alarm and waits for a period of time (cooldown) before the next one.
- Scheduled scaling, which changes capacity at fixed times, for changes you know about in advance.
- Predictive scaling, which analyzes the history, detects daily or weekly patterns and launches capacity before the load arrives, and which AWS suggests when traffic repeats in cycles and the application is slow to start.
For example, if the store knows it opens a sale every Friday night, it uses scheduled scaling to have more instances at that time. If its visits go up every morning and its instances are slow to start, predictive scaling gets them ready before the customers arrive.
How target tracking works
With target tracking, the group compares the metric with the target and adjusts the instances until they are close. For example, a group of 4 instances has its average CPU, which is how busy the processor is, at 78% against a target of 50%.

The instances report their CPU to CloudWatch, which is the AWS service that collects metrics. CloudWatch calculates the average, the alarm that the policy created when it was configured goes off and the group goes to 7 instances without anyone signing in to the console. The same cycle removes instances when the CPU stays below the target, so early in the morning the store stops paying for instances it doesn't use.
For the metric, AWS recommends one that decreases in proportion when you add capacity, so that if you double the group, the metric drops by half. Average CPU and the load balancer's requests per target behave this way, but the free memory of a single instance doesn't. For example, if with two instances each one receives a thousand requests per minute, when you go to four instances each one receives half.
Decoupling the tiers with a queue
An application usually has tiers, which are parts with different jobs: the web tier serves the visitors and another tier does the heavy work. When the web server also processes the orders, a spike in orders overloads it completely and it stops serving users. With an Amazon SQS queue in between, which is a line where messages are kept until someone handles them, the web tier only leaves one message per order and a tier of workers processes them at its own pace, so each tier scales on its own. The exam guide calls this decoupling workloads so that components can scale independently. For example, during a special sale the store's website keeps responding quickly even if many orders pile up in the queue.
To scale the workers, the number of messages in the queue isn't enough as a metric, because it doesn't take into account how many instances there are and it can launch too many instances while the queue empties. That is why AWS recommends the backlog per instance, which is the pending messages divided by the instances in the group.

For example, with 1,500 messages in the queue and 10 instances in the group, the backlog per instance is 150. The target comes from dividing the wait time you accept for a message (10 seconds) by how long each message takes to process (0.1 seconds), which gives 100. Because 150 is more than 100, the group adds five instances and the backlog goes back to 100 per instance.
Hibernating instances that are slow to start
Some instances take a long time to start and to load what they need into their memory before they can serve. You can hibernate those instances instead of stopping them, just like a laptop that you close and that picks up where you left off when you open it. EC2 saves the RAM, which is the working memory, to the EBS root volume and, when it starts again, resumes the processes where they were. For example, an instance that takes a long time to load the store's catalog into memory starts ready if it was hibernated.
Types of load balancers

In front of the group sits an Elastic Load Balancing load balancer, which receives all the traffic and distributes it among the instances so none of them gets overloaded. Load balancers are told apart by the network layer they work at: at layer 7 they read the content of each request, such as the address of the page that was requested, and at layer 4 they only see which address and which channel the traffic is going to. There are three current types, since the Classic Load Balancer is from the previous generation:
- Application Load Balancer (ALB), which works at layer 7 and receives the HTTP or HTTPS request. It checks the listener rules in priority order and sends it to the target group of the rule that applies. It is used for web applications and microservices.
- Network Load Balancer (NLB), which works at layer 4 with TCP, UDP and TLS, handles millions of requests per second and has a static IP address per zone, to which you can assign an Elastic IP address. It is used for traffic that isn't HTTP or for clients that need static IP addresses.
- Gateway Load Balancer (GWLB), which distributes traffic among virtual appliances, which are security programs such as firewalls or intrusion detection systems, with the GENEVE protocol on port 6081.
For example, the store uses an ALB to send requests for the payments path to one group of instances and requests for the catalog to another. On the other hand, an online game that uses UDP puts an NLB in front of its servers.
If your account uses the new experience
In a new experience account, EC2 Auto Scaling, Elastic Load Balancing and Amazon SQS are in the free plan, so you can build a group with its load balancer and a target tracking policy. Use small instances, and when you finish delete the group and the load balancer so you don't leave charges. For example, a group with a minimum of one instance keeps creating a new one every time you delete the previous one, so you have to delete the whole group.
On the exam
The questions on this topic describe how traffic changes or what breaks during peaks. These words in the question point to the answer:
- "Every Monday at 8", which points to scheduled, and "daily pattern" together with "slow start", which point to predictive.
- "Orders that are lost during peaks" or "the web tier is overloaded by processing", which point to an SQS queue with workers in their own group.
- "HTTP", "path-based rules" or "microservices", which point to ALB.
- "UDP", "static IP address" or "millions of requests", which point to NLB.
- "Third-party firewalls", which points to GWLB.
For example, if the question says "orders are lost when there are many users at once", the answer includes an SQS queue between the web tier and the workers.