BeginnerCompute

Compute Services

Understand AWS compute building blocks: EC2, Auto Scaling, Elastic Beanstalk, and Lambda, with direct Azure comparisons.

What Is It? (ELI5)

Compute is where your app code runs. EC2 is rented VM, Beanstalk is managed app hosting, Lambda runs code only when needed, and Auto Scaling adds/removes servers automatically.

Why Do We Need It?

How It Works (Technical)

AWS ServicePurposeAzure Equivalent
EC2Virtual machine with full OS controlAzure Virtual Machines
Auto ScalingAutomatic instance count changesVM Scale Sets autoscale
Elastic BeanstalkManaged app deployment platformAzure App Service
LambdaEvent-driven serverless functionsAzure Functions

Visual Representation

User Traffic -> Load Balancer -> Auto Scaling Group -> EC2 instances
Background jobs -> Lambda -> S3 / DynamoDB

Hands-on

# Launch a basic EC2 instance (example only)
aws ec2 run-instances --image-id ami-xxxxxxxx --instance-type t3.micro --count 1

# Create Lambda function package workflow
zip function.zip index.js
aws lambda create-function --function-name demo-fn --runtime nodejs20.x --handler index.handler --zip-file fileb://function.zip --role arn:aws:iam::ACCOUNT:role/lambda-role

Debugging Scenario

Problem

EC2 launched but app is unreachable.

Interview Questions

Beginner: EC2 vs Lambda?
EC2 gives full server control; Lambda is serverless and event-driven.
Intermediate: When to use Beanstalk?
When you want managed app deployment without managing every infrastructure component manually.
Scenario: Traffic spikes every Friday night. What architecture fits?
Use ALB + Auto Scaling group to increase EC2 capacity automatically.

Real-world Usage

An e-commerce app runs APIs on EC2 Auto Scaling and order processing tasks on Lambda for burst workloads.

Summary