Architecting on AWS
Architecting on AWS (Amazon Web Services) means planning how an application will use AWS services. You choose where the app runs, where data is stored and how users reach it.
You also plan for failures, protect access and watch costs. Think of a school website: it needs web servers, a database, backups and a way to keep working if one server fails.
AWS services are like LEGO blocks: a block for computers (EC2 (Elastic Compute Cloud)), a block for files (S3 (Simple Storage Service)), a block for databases (RDS (Relational Database Service)), a block for networks (VPC (Virtual Private Cloud)). An architect is the person who decides which blocks to use and how to fit them together so the building is strong, safe and not too expensive.
AWS global infrastructure
flowchart TB
G[AWS Global Infrastructure] --> R1[Region: ap-south-1 Mumbai]
G --> R2[Region: us-east-1 N. Virginia]
G --> E[Edge locations / PoPs<br/>CloudFront, Route 53]
R1 --> A1[AZ ap-south-1a<br/>one or more data centres]
R1 --> A2[AZ ap-south-1b]
R1 --> A3[AZ ap-south-1c]
| Concept | Meaning | What it means for your design |
|---|---|---|
| Region | A separate geographic area (for example Mumbai, Hyderabad) with its own independent infrastructure | Choose based on distance to users (speed), data laws, which services are available and price |
| Availability Zone (AZ) | One or more separate data centres inside a region, each with its own power, network and cooling. A problem in one AZ does not affect the others, but AZs are joined by very fast links | Put your app in at least two AZs so it keeps running if one fails |
| Edge location | A small site in many cities for fast content delivery and DNS (Domain Name System) | Keep copies of content close to users with CloudFront |
| Local Zones / Wavelength / Outposts | Extensions even closer to users, inside 5G networks, or inside your own building | Very low delay; hybrid setups |
Regions contain AZs; AZs contain data centres. High availability on AWS = spread resources across multiple AZs. Disaster recovery = keep a copy in another region.
Core AWS services for architects
| Category | Service | Use |
|---|---|---|
| Compute | EC2 | Virtual machines (servers) |
| Auto Scaling | Adds/removes EC2 servers automatically | |
| Elastic Load Balancing (ALB (Application Load Balancer)/NLB (Network Load Balancer)) | Shares traffic across servers and AZs | |
| Lambda | Run code without managing the underlying servers (serverless) | |
| ECS (Elastic Container Service) / EKS (Elastic Kubernetes Service) / Fargate | Run containers | |
| Elastic Beanstalk | PaaS (Platform as a Service) – upload your web app, AWS runs it | |
| Storage | S3 | Object storage for files, static websites, backups (99.999999999 % durability – "11 nines") |
| EBS (Elastic Block Store) | Disks attached to EC2 | |
| EFS (Elastic File System) / FSx | Shared file systems (folders shared by many servers) | |
| S3 Glacier | Very cheap long-term archive | |
| Database | RDS / Aurora | Managed relational databases (MySQL, PostgreSQL…), can keep a standby copy in another AZ (Multi-AZ) |
| DynamoDB | Managed NoSQL key-value database, answers in milliseconds | |
| ElastiCache | Redis/Memcached – a super-fast cache in memory | |
| Networking | VPC | Your own private, isolated network (next lesson) |
| Route 53 | DNS – turns names into addresses, health checks, routing rules | |
| CloudFront | CDN (Content Delivery Network) – delivers content from locations near users | |
| API Gateway | Managed front door for APIs | |
| Security | IAM (Identity and Access Management) | Users, groups, roles, permission policies |
| KMS (Key Management Service) / Secrets Manager | Encryption keys and stored passwords | |
| WAF (Web Application Firewall) / Shield | Web firewall, DDoS protection | |
| Cognito | Sign-up and sign-in for your app's users | |
| Management | CloudWatch | Metrics, logs, alarms |
| CloudTrail | A record of every API (Application Programming Interface) action (audit log) | |
| CloudFormation | Infrastructure as code (templates) | |
| Systems Manager | Patching servers, running commands on many servers | |
| Integration | SQS (Simple Queue Service) / SNS (Simple Notification Service) / EventBridge | Queues, notifications, events – so parts of an app don't depend directly on each other (decoupling) |
The AWS Well-Architected Framework
AWS's official checklist for judging and improving a design has six pillars:
| Pillar | What it is about | Key practices |
|---|---|---|
| 1. Operational excellence | Running and monitoring systems well, and improving how you work | Infrastructure as code, small changes that can be undone, written runbooks, good monitoring |
| 2. Security | Protecting data, systems and assets | Strong identity (least privilege, MFA (Multi-Factor Authentication)), full traceability (CloudTrail), security at every layer, encryption, automated security |
| 3. Reliability | Recovering from failures and handling demand | Multi-AZ, automatic recovery, scale out with many small servers, test recovery, stop guessing capacity |
| 4. Performance efficiency | Using resources efficiently as demand changes | Right server types, serverless, caching, CDNs, go global in minutes, experiment |
| 5. Cost optimisation | Not spending more than needed | Pay for what you use, right-size servers, Savings Plans/Reserved/Spot, switch off idle resources, measure |
| 6. Sustainability | Reducing environmental impact | Keep machines busy, use managed services, efficient hardware (Graviton), move less data |
Architectural design principles
- Design for failure – "everything fails all the time" (Werner Vogels, Amazon CTO). Assume any part can fail; build spares and automatic recovery.
- Scale horizontally – many small servers behind a load balancer, not one huge server.
- Decouple components – use queues (SQS) and events (SNS/EventBridge) so parts fail and grow independently. Like a restaurant order board: the waiter pins the order and the kitchen picks it up – neither waits for the other.
- Keep the app tier stateless – store user sessions in ElastiCache/DynamoDB, not on the server, so any server can handle any request.
- Use managed services – let AWS run databases, queues and load balancers for you.
- Automate everything – CloudFormation/Terraform, Auto Scaling, CI/CD (Continuous Integration and Continuous Delivery) pipelines.
- Think elastic – capacity follows demand.
- Secure every layer – defence in depth from the edge to the data.
- Use caching – CloudFront at the edge, ElastiCache in the app tier, read replicas for databases.
- Pick the right storage and database for each job (polyglot persistence – different databases for different needs).
- Avoid single points of failure – multi-AZ for every tier.
- Keep optimising cost – tag resources, watch spending, use Spot for flexible jobs.
Reference architecture: highly available three-tier web application
flowchart TB
U[Users] --> R53[Route 53 DNS]
R53 --> CF[CloudFront CDN + WAF]
CF --> S3S[(S3 – static assets)]
CF --> ALB[Application Load Balancer<br/>public subnets in AZ-a and AZ-b]
subgraph VPC[VPC 10.0.0.0/16]
ALB --> ASG
subgraph ASG[Auto Scaling Group – private app subnets]
EC2a[EC2 web/app<br/>AZ-a]
EC2b[EC2 web/app<br/>AZ-b]
end
EC2a & EC2b --> CACHE[(ElastiCache Redis<br/>sessions)]
EC2a & EC2b --> RDSP[(RDS primary<br/>AZ-a)]
RDSP -. synchronous replication .-> RDSS[(RDS standby<br/>AZ-b)]
EC2a & EC2b --> NAT[NAT gateways] --> IGW[Internet gateway]
end
EC2a & EC2b --> SQS[[SQS queue]] --> W[Worker instances / Lambda]
CW[CloudWatch alarms] -. scale .-> ASG
How a request flows:
- Route 53 finds the website address.
- CloudFront delivers stored files; WAF helps block attacks.
- The load balancer sends page requests to an EC2 server.
- Servers use Redis for session data and RDS for database records. RDS keeps a standby copy in another zone.
- SQS holds jobs for workers to do later.
- CloudWatch measures activity. Scaling rules can add or remove servers.
- NAT (Network Address Translation) gateways let private servers request Internet access.
How each pillar is satisfied:
- Reliability – two AZs for every tier; RDS Multi-AZ switches to the standby automatically; Auto Scaling replaces broken servers.
- Performance – CloudFront caches static content; Redis caches sessions and frequently used data.
- Security – only the load balancer is public; app and database tiers are in private subnets; security groups only allow traffic from the tier in front; WAF filters attacks; data is encrypted with KMS.
- Cost – Auto Scaling removes idle servers at night; S3 serves static files cheaply; Savings Plans for the always-on baseline.
- Operational excellence – the whole stack is defined in CloudFormation; logs and metrics are in CloudWatch.
Other common architecture patterns
| Pattern | Services |
|---|---|
| Static website | S3 + CloudFront + Route 53 + ACM (AWS Certificate Manager) certificate |
| Serverless API | API Gateway + Lambda + DynamoDB + Cognito |
| Event-driven processing | S3 upload → event → Lambda → SQS → workers |
| Batch / big data | S3 data lake + Glue + Athena/EMR, Spot instances |
| Hybrid (cloud + own data centre) | Site-to-Site VPN (Virtual Private Network) or Direct Connect + Transit Gateway |
| Disaster recovery | Backup & restore → pilot light → warm standby → multi-site active/active |
Disaster recovery strategies
| Strategy | Recovery time / data loss (RTO (Recovery Time Objective) / RPO (Recovery Point Objective)) | Cost | Everyday picture |
|---|---|---|---|
| Backup and restore | Hours | Lowest | Keeping photocopies of documents in a locker |
| Pilot light – the core database is copied live, servers are off | Tens of minutes | Low | A gas stove's pilot flame – small, but ready to light fully |
| Warm standby – a small working copy runs all the time | Minutes | Medium | A second shop open with fewer staff, ready to expand |
| Multi-site active/active – full copies serving users in two regions | Near zero | Highest | Two full branches both serving customers all the time |
Choosing EC2 purchase options
| Option | Best for | Saving vs On-Demand |
|---|---|---|
| On-Demand – pay per second, no commitment | Short or unpredictable workloads | – |
| Savings Plans / Reserved Instances – commit for 1 or 3 years | Steady, always-on usage | up to ~72 % |
| Spot Instances – AWS's spare capacity, can be taken back with 2 minutes' notice | Jobs that can be stopped and restarted | up to ~90 % |
| Dedicated Hosts – a whole physical server for you | Licensing or compliance rules needing physical servers | – |
Virtual lab · Amazon Web Services · 25 min
Deploy a web server on Amazon EC2
Launch a Linux virtual server in the AWS console, open HTTP in its firewall, bootstrap Apache with user data and connect over EC2 Instance Connect – the classic IaaS deployment.
Virtual lab · Amazon Web Services · 20 min
Store objects and host a static website on Amazon S3
Create a globally-unique bucket, upload objects, turn on versioning and configure static website hosting – object storage as a service.
Summary
- AWS infrastructure: regions → Availability Zones → data centres, plus edge locations.
- Core building blocks: EC2, Auto Scaling, ELB (Elastic Load Balancing), Lambda; S3, EBS, EFS; RDS, DynamoDB; VPC, Route 53, CloudFront; IAM, KMS; CloudWatch, CloudFormation; SQS/SNS.
- Well-Architected Framework – six pillars: operational excellence, security, reliability, performance efficiency, cost optimisation, sustainability.
- Design rules: design for failure, scale horizontally, decouple, stay stateless, automate, cache and secure every layer.
Practice questions
- Explain the AWS global infrastructure: regions, Availability Zones and edge locations.
- List the core AWS services under compute, storage, database, networking and security.
- Explain the six pillars of the AWS Well-Architected Framework.
- Draw and explain a highly available three-tier web architecture on AWS.
- Explain any eight architectural design principles for the cloud.
- Compare the four disaster-recovery strategies on AWS.
- Compare EC2 On-Demand, Reserved/Savings Plans and Spot instances.
Practise this topic
Hands-on virtual labs
Apply what you just read in a realistic, guided simulation. Free with a verified account.
Create a free account to track your progress and unlock virtual labs.