Lesson 7 of 11 · 10 min · Designing on AWS
A reference architecture and the Well-Architected pillars
What you will learn
- The classic three-tier architecture with EC2, S3 and RDS
- What each component is for and how traffic flows
- Modern variants: containers and serverless
- The six Well-Architected pillars and the questions they ask
- How to review an architecture and explain trade-offs in an interview
In simple words
Most web applications in the cloud have the same shape: a load balancer in front, application servers in the middle and a database behind. Learn that one picture and you can read most architecture diagrams. This lesson also gives you six questions for judging whether a design is good.
Words to know
- Architecture: how the parts of a system are arranged and connected.
- Three-tier: the common design with a web layer, an application layer and a database layer.
- Well-Architected: AWS's checklist of good design, in six areas such as security, reliability and cost.
- Trade-off: gaining one thing by giving up another, such as paying more for more reliability.
The classic three-tier web application
The most important diagram to be able to draw and explain:
Internet
│
Route 53 (DNS) ── CloudFront (CDN, TLS, caching) ── S3 (static files)
│
VPC 10.0.0.0/16 ▼
┌───────────────────────────────────────────────────────────────────────┐
│ public subnets (AZ a, AZ b) : Application Load Balancer, NAT gateways│
│ │ │
│ private app subnets (AZ a, b) : EC2 Auto Scaling group / ECS tasks │
│ │ └─────── S3 via gateway endpoint, SQS, Secrets │
│ private data subnets (AZ a, b): RDS Multi-AZ (primary + standby) │
│ ElastiCache (Redis) │
└───────────────────────────────────────────────────────────────────────┘
Roles of the tiers:
- Presentation / edge: DNS, CDN and the load balancer. Terminate TLS (ACM certificates, free), cache static content at the edge, absorb attacks (AWS WAF and Shield on CloudFront or the ALB).
- Application tier: stateless servers or containers running your code, in private subnets, in an Auto Scaling group across zones. They reach the internet through NAT gateways (or not at all) and AWS services through VPC endpoints.
- Data tier: the database (RDS/Aurora Multi-AZ), plus a cache; reachable only from the application tier's security group. S3 holds files: uploads, static assets, backups, logs. It lives outside the VPC as a regional service (reachable privately through a gateway endpoint).
How a request flows
- The browser resolves
www.shop.example(Route 53) to CloudFront or the ALB. - Static assets come from CloudFront's cache (originating from S3); dynamic requests go to the ALB (HTTPS, certificate from ACM).
- The ALB picks a healthy instance in one of the zones (path/host rules).
- The application queries the database (private IP, TLS), uses the cache for hot data, and stores uploads in S3 using its IAM role.
- Logs and metrics go to CloudWatch; the CloudTrail audit log records API calls (security lesson).
Where each service fits
| Component | Used for | Why this choice |
|---|---|---|
| EC2 (or ECS/EKS/Lambda) | running application code | control and compatibility; containers/serverless reduce operations |
| S3 | object storage: media, static sites, backups, logs, data lake | durable, cheap, scalable, integrates with everything |
| RDS / Aurora | relational data | managed backups, patching, Multi-AZ failover |
| ElastiCache | sessions, hot reads | cuts database load and latency |
| SQS / SNS / EventBridge | decoupling, async work, fan-out | absorbs bursts; retries; services scale independently |
| CloudFront | CDN | lower latency, less origin load, TLS at edge |
| IAM, KMS, Secrets Manager | identity, keys, secrets | least privilege; no keys in code |
| CloudWatch / CloudTrail | monitoring and audit | visibility |
Evolution: containers and serverless
The same logical tiers can use higher-level services:
- Containers (ECS Fargate/EKS) replace EC2 fleets: images from ECR, ALB target groups of tasks (containers lesson).
- Serverless: API Gateway or an ALB triggers Lambda functions; DynamoDB replaces RDS for key-based data; S3 events trigger processing; Step Functions orchestrate. There are no servers to patch and costs follow usage; trade-offs are cold starts, limits on duration and memory, vendor-specific design and harder local testing.
- Event-driven designs: services communicate through queues and events instead of synchronous calls, improving resilience (a slow consumer doesn't block producers) at the cost of eventual consistency and harder tracing.
Choose the simplest architecture that meets requirements; every extra component adds cost and failure modes. Many successful systems are "boring": a load balancer, a few containers, one managed database, a bucket.
The Well-Architected Framework
AWS summarises good practice as six pillars. Use them as a review checklist for any design (and as vocabulary for interviews):
| Pillar | Core question | Typical practices |
|---|---|---|
| Operational excellence | Can we run, observe and improve it? | infrastructure as code, CI/CD, small reversible changes, runbooks, observability, post-incident reviews |
| Security | Is it protected? | least-privilege IAM, MFA, encryption at rest and in transit, private networks, logging and audit (CloudTrail), automated checks, incident response plan |
| Reliability | Does it work correctly and recover? | multi-AZ, health checks, auto scaling, backups and tested restores, limits/quotas awareness, retries with backoff, change management, DR |
| Performance efficiency | Are we using the right resources efficiently? | right instance/storage types, caching/CDN, managed and serverless services, load tests, regions near users |
| Cost optimization | Do we pay only for value? | right-sizing, pricing models (Savings Plans/Spot), tagging, lifecycle rules, deleting waste, FinOps |
| Sustainability | Are we minimising environmental impact? | efficient utilisation, Graviton, right-sizing, managed services, avoiding idle resources, region choice |
Trade-offs are real: more reliability (multi-region, over-provisioning) costs more; maximum security can slow delivery. Architecture is choosing which to favour for this workload and being explicit about it.
The AWS Well-Architected Tool (free) walks you through questions per pillar and records risks; it is a structured design review.
How to review a design in an interview or a meeting
Ask in order:
- Requirements: users, traffic (average and peak), data size, latency, availability SLO, RPO/RTO, compliance, budget.
- Draw the flow: client → edge → app → data, then sideways (async, batch, analytics).
- Find single points of failure and the blast radius of each component.
- Stateless/stateful: where does state live and how is it protected and backed up?
- Scale: what breaks first at 10× traffic?
- Security: who can reach what; secrets; encryption; audit.
- Operations: deploys, rollbacks, monitoring, alerts, on-call.
- Cost: the main cost drivers and the cheapest sufficient option.
- Failure modes: what happens when each dependency is slow or down?
Common mistakes
- Over-engineering: Kubernetes, multi-region and ten services for a prototype.
- Under-engineering: one instance, one AZ, public database.
- Ignoring non-functional requirements until production.
- No data protection plan (backups, deletion protection, versioning).
- Using the console as the source of truth instead of code.
- Not documenting decisions and trade-offs (architecture decision records help).
Try it yourself
- Draw the three-tier architecture from memory with VPC, subnets, AZs, security groups, ALB, ASG, RDS, S3 and NAT, and label which resources are public.
- Choose one pillar and review an application you know against its questions; list three improvements.
- Redesign the same application with serverless components and compare cost, operations and risks.
- Run the free Well-Architected Tool on a sandbox workload (or a made-up one).
Check yourself
Which components of the three-tier architecture should be in public subnets?
Only the internet-facing pieces: the load balancer and NAT gateways. Application servers and databases belong in private subnets.
Name the six pillars of the Well-Architected Framework.
Operational excellence, security, reliability, performance efficiency, cost optimization and sustainability.
Why put a CDN and S3 in front of the static content?
It offloads the application servers, reduces latency by caching near users, lowers origin load and cost, and provides TLS and DDoS protection at the edge.
What role does a queue play in the architecture?
It decouples producers and consumers, absorbs bursts, enables retries and lets the two sides scale independently.
Interview questions
Walk me through the architecture of a typical production web app on AWS.
Route 53 and CloudFront in front; an ALB across AZs in public subnets; stateless app instances or containers in private subnets under auto scaling; Multi-AZ RDS and a cache in private data subnets; S3 for files; NAT/VPC endpoints for egress; IAM roles, KMS, Secrets Manager; CloudWatch and CloudTrail; everything defined as code and deployed through CI/CD.
How would you review an existing architecture for risk?
Use the Well-Architected pillars: find single points of failure, check IAM and network exposure, backup and restore evidence, scaling and cost behaviour, observability and operations, then prioritise findings by impact.
Monolith on EC2 or microservices on Kubernetes for a new startup product?
Start simple (a well-structured monolith or a few services on a managed platform) and split when team size and scaling needs justify the complexity; infrastructure choices should follow product needs.
Summary
- The reference architecture: edge (DNS, CDN, ALB) → stateless app tier in private subnets across AZs → Multi-AZ database and cache, with S3 for files and queues for decoupling.
- Containers and serverless are higher-level variants of the same tiers; choose the simplest that works.
- The six Well-Architected pillars form a review checklist and a vocabulary for trade-offs.
- Always ask about requirements, SPOFs, state, scale, security, operations, cost and failure modes.
Going deeper
- AWS Well-Architected Framework: the six pillars in full.
- AWS Well-Architected Tool: running a structured review.
- AWS Architecture Center: reference architectures and diagrams.
- Azure Architecture Center: equivalent guidance for Azure.
- Google Cloud Architecture Framework: the Google Cloud equivalent.
See how much of this you can explain
A free mock interview asks you new questions on Cloud platforms and AWS fundamentals for DevOps Engineer and scores every answer, with what to fix.