Study Guide · Bucket 2 of 7
Compute & Containers
Har application ko kahin na kahin run hona hai. Yeh bucket decide karta hai 'kahan' aur 'kaise' — server pe, function ki tarah, ya container mein.
Context
AWS ke paas 20+ compute services hain, lekin 95% real-world kaam sirf 5 se ho jaata hai: EC2, Lambda, ECS, Fargate, EKS. Baaki sab 'good to know' category mein aata hai.Amazon EC2Elastic Compute Cloud
What
Cloud mein ek virtual server — bas ek computer hai jo internet pe kahin chal raha hai. Pay-as-you-go: jitna use kiya utna bill.
Why
Traditional applications (jaise ek Swiggy/Uber-type backend) ko ek machine chahiye hoti hai jahan woh 24x7 chal sake. EC2 tumhe woh machine 2 minute mein deta hai, bina hardware khareede.
How
Instance type choose karo (CPU/RAM combo) -> OS choose karo (Linux/Windows) -> Launch dabao -> 1-2 minute mein server ready. AI/ML workloads ke liye special families hain: P-series (P4/P5 = GPU training), G-series (graphics/inference), aur AWS custom chips (Inferentia/Trainium).
Skill
Basic Linux commands, SSH, Bash scripting, AWS CLI — yeh sab non-negotiable hain.
- Instance families (general/compute/memory optimized)
- Pay-as-you-go pricing
- SSH access
- User-data startup scripts
AWS Lambdaserverless compute
What
Code run karo bina kisi server manage kiye. Function likho, upload karo, AWS use tab chalata hai jab koi trigger fire ho.
Why
Bahut saare tasks continuous server ki zaroorat nahi rakhte — e.g. 'jab bhi koi file S3 mein upload ho, usko process karo'. Lambda auto-scale karta hai aur sirf execution-time ka paisa lagta hai (idle time free).
How
Function likho (Python/Node.js) -> Trigger set karo (S3 upload, API call, EventBridge event) -> Trigger fire hote hi function automatically run hota hai -> AWS scaling khud handle karta hai.
Skill
Python/Node.js mein comfortable function likhna aana chahiye — expert nahi, comfortable.
- Event-driven execution
- No server management
- Pay per execution
- Cold starts
Amazon ECSElastic Container Service
What
Docker containers ko AWS pe run/manage karne ka native tareeka — Kubernetes se simpler.
Why
Modern apps containers mein package hote hain (consistent environment, easy deployment). ECS un containers ko kahan aur kaise run karna hai — yeh decide karta hai, bina Kubernetes ki complexity ke.
How
App ko Docker container mein package karo -> ECS ko batao kitne containers chahiye -> ECS scheduling, scaling, aur health sab khud manage karta hai.
Skill
Dockerfile likhna aur Docker commands (build/run/push) aana chahiye.
- Dockerfile syntax
- Basic Docker commands
- Task definitions
- Clusters/Services
AWS Fargateserverless containers
What
ECS/EKS ke saath use hota hai — but infrastructure (EC2 servers) manage karne ki zaroorat nahi. Sirf CPU/RAM specify karo, AWS baaki sab handle karta hai.
Why
ECS mein tumhe instance type, min/max scaling sab manually configure karna padta hai. Fargate mein bas resource requirement batao — server provisioning AWS ka problem hai, tumhara nahi.
How
Task definition mein Fargate launch-type choose karo -> CPU/memory specify karo -> deploy karo. No EC2 instances to patch or manage.
Skill
Same as ECS — Docker knowledge chahiye.
- ECS vs Fargate trade-off
- No server management
Amazon EKSElastic Kubernetes Service
What
Managed Kubernetes control plane on AWS. Agar tumhari team Kubernetes use karti hai, EKS us control-plane ka management AWS ko de deta hai.
Why
Bahut saari companies Kubernetes ecosystem (kubectl, Helm, custom operators) pe dependent hain. EKS unhe woh flexibility deta hai bina apna control-plane operate kiye.
How
AWS control plane manage karta hai -> tum kubectl/Helm se apps deploy karte ho -> Pods, Deployments, Services, RBAC — sab Kubernetes concepts yahan lagte hain.
Skill
Dockerfile + Kubernetes YAML likhna aana chahiye (AI tools help karte hain yahan).
- Pods, Deployments, Services, RBAC
- YAML manifests
- kubectl / Helm
- EKS vs ECS trade-off — common interview Q
Real org mein
Real org mein: chhoti teams/startups usually ECS ya Fargate use karte hain (simple, kam overhead). Bade orgs jahan multiple teams same Kubernetes patterns share karte hain, wahan EKS common hai. 'Hum EKS kyun use karte hain' — interview mein bolna: jab multi-cloud portability ya Kubernetes-specific tooling zaroori ho.Baaki Compute Services (TL;DR)good to know
What
EC2 Spot Instances (70-90% cheaper, but AWS 2-min notice pe terminate kar sakta hai), EC2 Auto Scaling (demand ke hisaab se instance count badhna/ghatna), AWS Batch (bulk computing jobs), Savings Plans / Compute Optimizer (cost tools).
Why
Yeh sab cost-optimization aur scale ke tools hain — job ke waqt seekh lena, abhi deep dive zaroori nahi.
How
Spot Instances non-critical/interruptible workloads ke liye; Auto Scaling traffic-based scaling ke liye.
Skill
Awareness level — hands-on abhi optional.
- Spot vs On-Demand
- Auto Scaling Groups
- Batch processing
Decision Tree — kaunsi service kab
- Server hamesha chalte rehna chahiye → EC2
- Event-driven ya short/sporadic tasks → Lambda
- Containerized app, simple rakhna hai → ECS ya Fargate
- Team already Kubernetes use karti hai → EKS
- GPU chahiye (AI training/inference) → EC2 (P / G instance families)
Key Tasks — is bucket ko 'done' maanne se pehle
- EC2 instance console se launch karo, SSH se connect karo
- Wahi instance ab AWS CLI se launch karo
- Ek simple Lambda function likho jo S3 upload pe trigger ho
- Ek app ko Dockerfile mein package karo, ECS pe deploy karo
- Decision tree ko bina dekhe explain kar sako