AWS Cloud Practitoner Part 02
π§ AWS: Compute Options for Website Deployment (Service Models, Lambda, Containers, and More)
π Overview
When deploying a website on AWS, choosing the right compute model is crucial. Depending on your team size, scaling needs, and operational preferences, AWS offers:
- Unmanaged services (you manage everything)
- Managed services (shared responsibility)
- Fully managed services (AWS handles it all)
- Containers & Orchestration (balance of control and abstraction)
- Other compute services (for specific use cases)
This guide explains each with technical details and interview insights.
π§± 1. AWS Service Management Levels
| Type | Control Level | Ops Responsibility | Examples | Best Use Case |
|---|---|---|---|---|
| Unmanaged | Full | You handle everything | EC2, EBS | Custom setups, full control |
| Managed | Partial | AWS manages infra | RDS, Elastic Beanstalk, ECS | Common web stacks, moderate flexibility |
| Fully Managed | Minimal | AWS handles it all | Lambda, S3, DynamoDB, Amplify | Fast development, minimal ops |
π§ 2. Unmanaged Services
β EC2 for Web Apps
- Launch VMs and install everything: web servers, runtimes, DBs.
- Full responsibility for OS updates, security, scaling, backups.
π§ Interview Insight:
βEC2 gives me full control, ideal for legacy or custom apps. But it comes with high operational overhead.β
βοΈ 3. Managed Services
β Elastic Beanstalk
- Platform-as-a-Service (PaaS) for web apps.
- You deploy code; AWS handles provisioning, scaling, load balancing.
- Works with Java, Python, Node.js, PHP, Ruby, Go, .NET.
π§ Interview Insight:
βElastic Beanstalk helps deploy web apps quickly with minimal configuration while still giving access to EC2 under the hood.β
β RDS
- Managed relational databases (MySQL, PostgreSQL, SQL Server).
- Backups, patches, failover, Multi-AZ support.
β Amazon ECS (Elastic Container Service)
- Managed container orchestration.
- Can run on EC2 or Fargate (serverless containers).
- Works well with ALB, IAM, CloudWatch.
β AWS Fargate
- Serverless compute engine for ECS and EKS.
- No server management; just define container specs.
βοΈ 4. Fully Managed Services
β AWS Lambda
- Run code without provisioning servers.
- Event-driven, auto-scaling, stateless.
- Ideal for APIs, file processing, microservices.
β Amazon S3 + CloudFront
- S3 hosts static frontend (HTML/JS/CSS).
- CloudFront caches globally with HTTPS support.
β AWS Amplify
- Full-stack app deployment (frontend + backend).
- Supports hosting, GraphQL/REST APIs, auth (Cognito), and CI/CD.
π§ͺ Lambda Deep Dive
| Feature | Details |
|---|---|
| Stateless | No persistence between runs |
| Max Timeout | 15 minutes |
| Memory | 128 MB β 10 GB |
| Languages | Node.js, Python, Java, Go, etc. |
| Cold Start | Latency during first invocation |
π Lambda Triggers
- API Gateway
- S3
- DynamoDB Streams
- EventBridge
- SQS/SNS
π§ Lambda Interview Insights
Q: When do you use Lambda?
βFor event-driven use cases like APIs, file processing, or data pipelines.β
Q: What are cold starts?
βCold starts happen when a new Lambda instance initializes. Use provisioned concurrency to reduce latency.β
ποΈ Website Architecture with Lambda
1
2
3
4
5
6
7
[Frontend (React/S3)]
β
[Amazon API Gateway]
β
[Lambda Functions]
β
[DynamoDB / RDS / S3]
π³ 5. Containers & Orchestration
Containers give more flexibility than Lambda and more efficiency than EC2.
β ECS (Elastic Container Service)
- AWS-native container orchestration.
- Integrates with EC2 or Fargate.
- Define task definitions, services, and clusters.
β AWS EKS (Elastic Kubernetes Service)
- Managed Kubernetes control plane.
- Use
kubectl, Helm, ArgoCD, etc. - More complex but ideal for cloud-agnostic strategies.
π§ Container Interview Insights
Q: ECS vs EKS?
βECS is simpler and deeply integrated with AWS. EKS is powerful but better for teams with Kubernetes experience.β
Q: ECS (Fargate) vs Lambda?
βUse ECS Fargate when you need container flexibility or longer runtimes, and Lambda when you want minimal infrastructure.β
ποΈ Website Architecture with Containers
1
2
3
4
5
[Frontend (React/S3/ALB)]
β
[ECS/EKS (Fargate) App Services]
β
[RDS / DynamoDB / ElastiCache / S3]
βοΈ 6. Other AWS Compute Services
β Elastic Beanstalk (Recap)
- Deploy web apps without managing infrastructure.
- Control platform versions, scaling settings, health checks.
- Gives access to underlying EC2 if needed.
β AWS Batch
- Fully managed batch processing at scale.
- Automatically provisions compute resources.
- Ideal for data pipelines, ML training jobs, and simulations.
π§ Interview Insight:
βI use AWS Batch when I need to run large-scale, parallel, non-interactive compute jobs without managing queues or servers.β
β Amazon Lightsail
- Simplified cloud VPS with predictable pricing.
- Pre-configured stacks: WordPress, LAMP, Node.js, etc.
- Includes networking, DNS, snapshots.
π§ Interview Insight:
βLightsail is perfect for small apps or quick MVPs. Itβs simpler than EC2 and includes everything from DNS to firewall.β
β AWS Outposts
- AWS infrastructure deployed on-premises.
- Run EC2, RDS, S3 locally with same AWS APIs.
- Ideal for low-latency or data residency use cases.
π§ Interview Insight:
βOutposts is for hybrid workloads where local processing is needed but AWS consistency must be preserved.β
π Final Decision Table: Which to Choose?
| Service | When to Use |
|---|---|
| EC2 | Full control, custom OS, legacy or licensed apps |
| Elastic Beanstalk | Simplified app deployment without deep ops knowledge |
| Lambda | Event-driven, short-lived tasks with no server management |
| ECS/Fargate | Dockerized workloads with control over runtime |
| EKS | Kubernetes-native teams or multi-cloud strategy |
| AWS Batch | Parallel job processing, ML model training, simulations |
| Lightsail | Quick, low-cost VPS with simple app hosting |
| Outposts | Hybrid infrastructure or local data compliance requirements |
π οΈ Bonus: Deployment Stack Examples
β Serverless Web App (Frontend + Backend)
1
2
3
4
5
6
7
[React Frontend - S3 + CloudFront]
β
[Amazon API Gateway]
β
[Lambda]
β
[DynamoDB / Aurora Serverless / S3]
β Containerized Web App
1
2
3
4
5
[React or Next.js Frontend - S3 or ALB]
β
[Backend on ECS or EKS (Fargate)]
β
[RDS / ElastiCache / DynamoDB / S3]
β Batch or Scheduled App
1
2
3
4
5
[EventBridge Schedule]
β
[AWS Batch]
β
[Process large jobs / transform / export data]
π§ Pro Interview Tip: Show you understand trade-offs:
- Lambda is fastest to deploy but stateless and time-limited.
- ECS gives flexibility with containerization.
- EKS offers control but requires expertise.
- Lightsail and Beanstalk are great for bootstrapping.