All Scenarios
easySAAHA/DRArchitecture

3-Tier Web App with HA

A retail company is migrating its on-prem PHP web app to AWS. They want HA with sub-minute failover, stateless scaling, and MySQL backend. What does the architecture look like?

Key Constraints

Multi-AZ required
Stateless app servers
MySQL database (RDS)
Auto-scaling based on CPU

Reference Architecture (interactive 3D)

🖱️ Drag to rotate · 📜 Scroll to zoom

Loading diagram...

Reference Architecture

  1. 1Route 53 ALIAS → CloudFront for global edge caching, free TLS, and Shield Standard DDoS protection.
  2. 2ALB in public subnets across two AZs distributes traffic to EC2 in private subnets.
  3. 3Auto Scaling Group spans both AZs; instances are stateless (sessions in ElastiCache).
  4. 4ElastiCache (Redis) for session store and hot DB query results.
  5. 5RDS MySQL with Multi-AZ enabled — synchronous replica in second AZ, automatic failover (~60s).
  6. 6Static assets served from S3 directly via CloudFront (offloads app servers).
  7. 7CloudWatch alarms → ASG scaling policies on CPU > 70%.

Common Traps (Wrong Answers)

  • Single-AZ deployment (kills HA on AZ failure)
  • Sticky sessions on ALB (couples user to instance, breaks scaling)
  • RDS without Multi-AZ (cannot survive AZ failure, no automatic failover)
  • Skipping CloudFront for a 'simple' app (misses free DDoS + TLS termination)
  • EC2 in public subnets (unnecessary attack surface)

Try the simulator

Build this architecture yourself in the drag-and-drop simulator.