Skip to Content

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.

WhatIsTheTime.com grows in four steps: one t2.micro instance with an Elastic IP; scale up to a bigger M5 instance with downtime; scale out to several instances with Route 53 A records, where a one-hour TTL leaves clients with stale IPs; then an Application Load Balancer with health checks and an Auto Scaling group across at least two Availability Zones WhatIsTheTime.com grows in four steps: one t2.micro instance with an Elastic IP; scale up to a bigger M5 instance with downtime; scale out to several instances with Route 53 A records, where a one-hour TTL leaves clients with stale IPs; then an Application Load Balancer with health checks and an Auto Scaling group across at least two Availability Zones

Four steps from one server to a self-healing fleet.

Step by step

  1. Start simple. One t2.micro instance with a public IP. When it's restarted the public IP changes, so an Elastic IP is attached to keep a fixed address.
  2. 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.
  3. 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.
  4. 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.
  5. 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).
  6. Add an Auto Scaling group. An ASG adds and removes instances with demand and replaces unhealthy ones.
  7. Go Multi-AZ. Spread the ALB and the ASG over at least two AZs, so losing a data center doesn't stop the app.
  8. 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

The final WhatIsTheTime.com: users resolve the name with a Route 53 alias record, then send HTTPS requests to an Application Load Balancer with health checks, which spreads them across EC2 instances in an Auto Scaling group that spans Availability Zones A and B The final WhatIsTheTime.com: users resolve the name with a Route 53 alias record, then send HTTPS requests to an Application Load Balancer with health checks, which spreads them across EC2 instances in an Auto Scaling group that spans Availability Zones A and B

The classic highly available web tier.

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.small instances 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

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt