Post

AWS Cloud Practitoner Part 02

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:

  1. Unmanaged services (you manage everything)
  2. Managed services (shared responsibility)
  3. Fully managed services (AWS handles it all)
  4. Containers & Orchestration (balance of control and abstraction)
  5. Other compute services (for specific use cases)

This guide explains each with technical details and interview insights.


🧱 1. AWS Service Management Levels

TypeControl LevelOps ResponsibilityExamplesBest Use Case
UnmanagedFullYou handle everythingEC2, EBSCustom setups, full control
ManagedPartialAWS manages infraRDS, Elastic Beanstalk, ECSCommon web stacks, moderate flexibility
Fully ManagedMinimalAWS handles it allLambda, S3, DynamoDB, AmplifyFast 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

FeatureDetails
StatelessNo persistence between runs
Max Timeout15 minutes
Memory128 MB – 10 GB
LanguagesNode.js, Python, Java, Go, etc.
Cold StartLatency 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?

ServiceWhen to Use
EC2Full control, custom OS, legacy or licensed apps
Elastic BeanstalkSimplified app deployment without deep ops knowledge
LambdaEvent-driven, short-lived tasks with no server management
ECS/FargateDockerized workloads with control over runtime
EKSKubernetes-native teams or multi-cloud strategy
AWS BatchParallel job processing, ML model training, simulations
LightsailQuick, low-cost VPS with simple app hosting
OutpostsHybrid 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.

πŸ™Œ Connect With Me

GitHub LinkedIn YouTube Gmail

This post is licensed under CC BY 4.0 by the author.