Stateless web app: WhatIsTheTime.com
How a stateless website grows from one EC2 instance with an Elastic IP to a load balancer and an Auto Scaling group across Availability Zones, and what each step teaches for the exam.
The app
WhatIsTheTime.com tells people the time. It needs no database and keeps nothing about its users: every request can be answered by any server. That makes it stateless, the easiest kind of app to scale.
The goal is to scale it vertically and horizontally, with no downtime, as traffic grows. The story goes in steps.
Step by step
- Start simple. One
t2.microinstance with a public IP. When it's restarted the public IP changes, so an Elastic IP is attached to keep a fixed address. - Scale vertically. Traffic grows: stop the instance and change it to a bigger
m5.large. It works, but the stop causes downtime, and one instance is still a single point of failure. - Scale horizontally with Elastic IPs. Add more instances, each with its own Elastic IP, and give users the list. Users must know every IP, and the limit is 5 Elastic IPs per Region by default.
- Use Route 53 A records. One name,
api.whatisthetime.com, returns the IPs of all instances. But when an instance is removed, users who cached the answer keep using its old IP until the TTL (say 1 hour) expires. - Add a load balancer. Put the instances in private subnets behind a public Application Load Balancer with health checks. The instances' security group allows traffic only from the load balancer's security group. Route 53 points to the ALB with an alias record (the ALB's IPs change, so an A record with fixed IPs won't do).
- Add an Auto Scaling group. An ASG adds and removes instances with demand and replaces unhealthy ones.
- Go Multi-AZ. Spread the ALB and the ASG over at least two AZs, so losing a data center doesn't stop the app.
- Cut the cost. The ASG always runs at least 2 instances: cover that minimum with Reserved Instances or Savings Plans, and let On-Demand (or Spot) handle the peaks.
The final architecture
What the steps covered, in exam terms:
- public vs private IPs and Elastic IPs on EC2;
- Route 53 A records, TTLs and alias records;
- ELB health checks and security groups that reference each other;
- Auto Scaling groups and Multi-AZ for high availability;
- reserved capacity for the steady part of the load, to save cost.
Real-world examples
- A weather widget API is served by 2–10
t3.smallinstances in an ASG across three AZs behind an ALB, with a Compute Savings Plan covering the 2 that always run.
Exam tips
- "Highly available web tier on EC2" → ALB + Auto Scaling group across at least two AZs.
- "Point a domain name at a load balancer" → Route 53 alias record, never an A record with IPs.
- "Instances should only accept traffic from the load balancer" → instance security group allows the ALB's security group as the source.
- "Steady minimum capacity, cheapest" → Reserved Instances or Savings Plans for the minimum, On-Demand or Spot above it.
Common traps
- "Scaling vertically gives high availability." It's still one instance, and resizing means downtime.
- "Use Route 53 A records with the instances' IPs to load balance." Clients cache IPs for the TTL and keep hitting removed instances; there are no health-based replacements. Use an ELB.
- "Many Elastic IPs scale the app." There's a quota of 5 per Region by default, and clients must know them all.
Check yourself
Create a launch template from the app's AMI, an Auto Scaling group over at least two AZs, and an Application Load Balancer with health checks in front. Point the domain at the ALB with a Route 53 alias record.
Clients cached the old IP for the record's TTL. Put the instances behind a load balancer and use an alias record to it: the load balancer stops sending traffic to removed or unhealthy instances right away.
AWS documentation
Architecture Patterns
How to read SAA-C03 scenario questions, and a catalog of the classic, serverless and building-block architectures that the exam keeps coming back to.
Stateful web app: MyClothes.com
Where to keep session state in a scalable shopping site (sticky sessions, cookies, ElastiCache or DynamoDB), scaling reads with read replicas and caching, Multi-AZ, and security groups between tiers.