1.Three-Tier Web Application
The three-tier pattern splits a web application into a presentation tier a browser talks to, an application tier that runs your code, and a data tier that stores state. On AWS that is Route 53 and CloudFront at the edge, an Application Load Balancer in public subnets, containers or instances in private subnets, and RDS plus ElastiCache plus S3 behind them. Every tier sits in at least two Availability Zones.
Key features
- Only the load balancer sits in public subnets; application and data tiers sit in private subnets with no route to an internet gateway
- Security groups chain by reference: the app tier allows the ALB's security group, the database allows the app tier's — never CIDR ranges
- CloudFront serves static assets from S3 and forwards dynamic paths to the ALB, so one domain covers both
- An ACM certificate used by CloudFront must be requested or imported in US East (N. Virginia) (us-east-1)
- The application tier must be stateless: sessions live in ElastiCache or a cookie, uploads live in S3, so any instance can serve any request
- ElastiCache is a read accelerator in front of RDS, never the system of record — a cache flush must only cost latency
Each tier: what it owns, where it lives, what reaches it
- A five-band diagram, read top to bottom, with an arrow between each band.
- Band 1, Client: users on the internet.
- Band 2, Edge (global): Route 53 resolves the domain, CloudFront and AWS WAF terminate TLS and filter requests, and S3 holds static assets served through CloudFront.
- Band 3, Public subnets across two Availability Zones: the Application Load Balancer, and a NAT gateway for outbound-only traffic from private subnets.
- Band 4, Private application subnets across two Availability Zones: ECS tasks or EC2 instances in an Auto Scaling group, one set per zone.
- Band 5, Private data subnets across two Availability Zones: RDS with a Multi-AZ standby, and ElastiCache.
- Footnote: only band 3 has a route to an internet gateway, and each tier accepts traffic only from the tier directly above it.
Signature
Route 53 → CloudFront/WAF → ALB (public) → ECS/EC2 (private) → RDS + ElastiCache + S3
Route 53 and CloudFront at the edge, ALB in public subnets, application in private subnets, data in private subnets with no default route — traffic only ever moves downward, security groups reference the group above rather than a CIDR, and the application tier holds no state.