AWS Serverless Services Cheat Sheet

AWS Serverless Services Cheat Sheet

  • AWS serverless services allow running applications without provisioning or managing servers.
  • Services automatically scale, provide built-in high availability, and use pay-per-use pricing.
  • Core serverless stack: Lambda (compute) + API Gateway (API) + DynamoDB (database) + S3 (storage) + EventBridge (events) + Step Functions (orchestration).

Compute

AWS Lambda

  • Run code without provisioning servers – event-driven, function-as-a-service.
  • Triggers: 200+ event sources (S3, DynamoDB, SQS, API Gateway, EventBridge, Kinesis, etc.).
  • Duration: max 15 minutes per invocation.
  • Memory: 128MB – 10GB (CPU proportional).
  • Concurrency: 1,000 default (can increase); Reserved and Provisioned Concurrency available.
  • Pricing: per request ($0.20/million) + per GB-second of compute.
  • Deployment: ZIP package (250MB unzipped) or container image (10GB).
  • Layers: share code/libraries across functions (up to 5 layers).
  • Versions & Aliases: immutable versions with aliases for traffic shifting (canary/linear).
  • Lambda@Edge: run at CloudFront edge locations (viewer/origin request/response).
  • SnapStart: reduce cold starts for Java functions (caches initialized snapshot).

AWS Fargate

  • Serverless compute for containers – works with ECS and EKS.
  • No EC2 instances to manage – per-task pricing (vCPU + memory per second).
  • Each task runs in isolated microVM (Firecracker).
  • Fargate Spot: up to 70% savings for fault-tolerant workloads.

AWS App Runner

  • Fully managed – deploy from source code (GitHub) or container image to running web service in minutes.
  • Auto-scales based on traffic; can pause when idle.
  • Built-in HTTPS endpoint, load balancing, and certificate management.

API & Integration

Amazon API Gateway

  • Create, publish, and manage REST, HTTP, and WebSocket APIs.
  • REST API: full-featured (caching, request validation, WAF, usage plans, API keys).
  • HTTP API: lower latency, lower cost, simpler (JWT authorizers, OIDC).
  • WebSocket API: real-time two-way communication.
  • Integrates with Lambda, HTTP backends, AWS services, and Mock integrations.
  • Throttling: 10,000 requests/second default (account-level), burst 5,000.
  • Stages: dev/staging/prod with stage variables and canary deployments.

AWS Step Functions

  • Serverless orchestration – coordinate multiple AWS services into workflows.
  • Standard Workflows: up to 1 year, exactly-once execution, audit history.
  • Express Workflows: up to 5 minutes, at-least-once, high-volume event processing.
  • States: Task, Choice, Parallel, Map, Wait, Pass, Succeed, Fail.
  • Direct 200+ AWS service integrations (DynamoDB, SQS, SNS, ECS, Bedrock, etc.).
  • Distributed Map: process millions of items in parallel from S3.
  • Built-in error handling with Retry and Catch.

Amazon EventBridge

  • Serverless event bus for event-driven architectures.
  • 90+ AWS service events automatically; SaaS partner events; custom events.
  • Content-based filtering, event archive/replay, schema registry.
  • EventBridge Scheduler: one-time and recurring schedules (replaces CloudWatch Events cron).
  • EventBridge Pipes: point-to-point integration with filtering and enrichment.

Data & Storage

Amazon DynamoDB

  • Serverless NoSQL database – single-digit millisecond latency at any scale.
  • Capacity modes: On-Demand (pay per request) or Provisioned (with Auto Scaling).
  • DynamoDB Streams: capture item-level changes for event-driven processing.
  • Global Tables: multi-region, multi-active replication.
  • DAX: in-memory cache for microsecond read latency.
  • TTL: automatic item expiration at no cost.

Amazon S3

  • Serverless object storage – unlimited capacity, 11 nines durability.
  • Event notifications to Lambda, SQS, SNS, EventBridge.
  • S3 Object Lambda: transform data on retrieval using Lambda.

Amazon Aurora Serverless v2

  • Serverless relational database – scales instantly from 0.5 to 256 ACUs.
  • MySQL and PostgreSQL compatible.
  • Scales to zero (when paused) for development workloads.

Messaging

Amazon SQS

  • Serverless message queue – Standard (unlimited throughput) or FIFO (ordering + exactly-once).
  • Retention up to 14 days. Visibility timeout, delay queues, dead-letter queues.

Amazon SNS

  • Serverless pub/sub messaging – fan out to SQS, Lambda, HTTP, email, SMS.
  • Message filtering on attributes. FIFO topics for ordered fan-out.

Other Serverless Services

  • AWS AppSync – managed GraphQL and Pub/Sub API with real-time data sync.
  • Amazon Cognito – serverless user authentication, authorization, and user management.
  • AWS SAM (Serverless Application Model) – framework for building serverless applications (extends CloudFormation).
  • Amazon Kinesis Data Firehose – serverless streaming ETL to S3, Redshift, OpenSearch.
  • AWS Glue – serverless ETL for data preparation.
  • Amazon OpenSearch Serverless – serverless search and analytics.

Serverless Architecture Patterns

  • Synchronous API: API Gateway → Lambda → DynamoDB
  • Asynchronous Processing: S3 Event → SQS → Lambda → DynamoDB
  • Fan-out: SNS → multiple SQS queues → Lambda consumers
  • Orchestration: API Gateway → Step Functions → (Lambda + DynamoDB + SNS)
  • Event-driven: EventBridge → Lambda / Step Functions / SQS
  • Streaming: Kinesis → Lambda → DynamoDB / S3

AWS Certification Exam Practice Questions

  1. A serverless application needs to coordinate a multi-step order processing workflow that includes payment, inventory check, and shipping. Each step may take variable time and needs error handling with retries. Which service orchestrates this?
    1. Amazon SQS with multiple queues
    2. Lambda calling Lambda
    3. AWS Step Functions
    4. EventBridge rules
  2. A Lambda function needs to process messages from an SQS queue but should handle no more than 5 messages concurrently to avoid overwhelming a downstream API. What controls this?
    1. SQS visibility timeout
    2. Lambda Reserved Concurrency set to 5
    3. SQS MaximumBatchSize
    4. Lambda timeout
  3. An application needs a serverless relational database that automatically scales based on load and has zero cost when there are no connections. Which service provides this?
    1. DynamoDB On-Demand
    2. RDS with Auto Scaling
    3. Aurora Serverless v2 (with pause)
    4. ElastiCache Serverless
  4. A company wants to create a REST API with caching, request validation, API keys for rate limiting, and AWS WAF integration. Which API Gateway type should they use?
    1. HTTP API
    2. REST API
    3. WebSocket API
    4. AppSync

Related Posts

References

AWS Serverless Overview

AWS Lambda Developer Guide

AWS Step Functions Developer Guide

AWS AI & ML Services Cheat Sheet

AWS AI & ML Services Cheat Sheet

  • AWS provides a comprehensive suite of AI and Machine Learning services spanning generative AI, ML platforms, AI services, and responsible AI.
  • Services range from pre-trained APIs requiring no ML expertise to fully managed platforms for custom model training and deployment.
  • This cheat sheet covers services relevant to the AWS AI Practitioner (AIF-C01), ML Engineer Associate (MLA-C01), and Solutions Architect certifications.
🎓 Build AI Skills with Google
Learn practical AI skills and earn a Google Certificate. No experience required – learn at your own pace.
Start the Google AI Essentials Learning Path →

Generative AI Services

Amazon Bedrock

  • Fully managed service to build generative AI applications using foundation models (FMs).
  • Access models from AI21 Labs, Anthropic (Claude), Cohere, Meta (Llama), Mistral, Stability AI, and Amazon (Titan).
  • No infrastructure to manage – serverless API access to foundation models.
  • Knowledge Bases – implement RAG (Retrieval Augmented Generation) by connecting FMs to your data sources (S3, databases).
  • Agents – create AI agents that can plan, execute multi-step tasks, and call APIs/Lambda functions.
  • Guardrails – control model outputs with content filters, denied topics, PII redaction, and word filters.
  • Model Evaluation – evaluate and compare FM performance on your specific tasks.
  • Fine-tuning – customize models with your data (continued pre-training or instruction fine-tuning).
  • Provisioned Throughput – reserve model capacity for consistent performance.
  • Data is not used to train base models – data privacy by default.

Amazon Q

  • Amazon Q Business – AI assistant for enterprise that connects to company data (S3, SharePoint, Confluence, Salesforce, etc.).
  • Amazon Q Developer – AI coding assistant for IDEs with code generation, debugging, transformation, and security scanning.
  • Amazon Q in QuickSight – natural language queries for BI dashboards.
  • Amazon Q in Connect – AI-powered agent assistance for contact centers.
  • Respects existing access controls and permissions – users only see answers from data they can access.

Amazon Titan Models

  • Titan Text – text generation, summarization, classification, Q&A.
  • Titan Embeddings – convert text to numerical vectors for search, RAG, and recommendations.
  • Titan Image Generator – generate and edit images from text prompts.
  • Titan Multimodal Embeddings – embeddings for both text and images.
  • All Titan models include built-in watermarking for generated content.

ML Platform

Amazon SageMaker

  • Fully managed ML platform for building, training, and deploying models at scale.
  • SageMaker Studio – integrated IDE for ML development (notebooks, experiments, pipelines).
  • Built-in algorithms – XGBoost, Linear Learner, K-Means, Image Classification, Object Detection, etc.
  • Training – managed training infrastructure with spot instances (up to 90% savings).
  • SageMaker Pipelines – CI/CD for ML (MLOps) with automated workflow orchestration.
  • Model Registry – catalog, version, and manage trained models.
  • SageMaker ML Lineage Tracking – automatically tracks end-to-end relationships from data → training → model → endpoint; supports cross-account lineage sharing via RAM for enterprise governance and compliance audits.
  • Endpoints – real-time inference, batch transform, async inference, serverless inference.
  • SageMaker Canvas – no-code ML for business analysts (visual interface).
  • SageMaker JumpStart – pre-trained foundation models and ML solutions ready to deploy.
  • SageMaker Clarify – detect bias in data/models and explain model predictions (SHAP values).
  • SageMaker Data Wrangler – visual data preparation and feature engineering.
  • SageMaker Feature Store – centralized repository for ML features (online + offline store).
  • SageMaker Ground Truth – data labeling with human annotators and active learning.
  • SageMaker Model Monitor – detect data drift, model quality drift, and bias drift in production.

AI Services (Pre-trained APIs)

Natural Language Processing (NLP)

  • Amazon Comprehend – NLP service for sentiment analysis, entity recognition, key phrases, language detection, PII detection, topic modeling.
  • Amazon Comprehend Medical – extract medical entities (conditions, medications, dosages) from clinical text.
  • Amazon Translate – neural machine translation for 75+ languages with custom terminology support.
  • Amazon Transcribe – speech-to-text (ASR) with speaker identification, custom vocabulary, PII redaction.
  • Amazon Transcribe Medical – medical speech-to-text for clinical documentation.

Vision

  • Amazon Rekognition – image and video analysis (object/scene detection, face analysis, text in images, content moderation, celebrity recognition, custom labels).
  • Amazon Textract – extract text, tables, and forms from documents (beyond basic OCR). Supports invoices, receipts, ID documents.

Speech

  • Amazon Polly – text-to-speech with neural and standard voices, SSML support, speech marks for lip-sync.
  • Amazon Lex – build conversational chatbots with automatic speech recognition (ASR) and natural language understanding (NLU). Powers Alexa technology.

Search & Recommendations

  • Amazon Kendra – intelligent enterprise search powered by ML with natural language queries and document ranking.
  • Amazon Personalize – real-time personalized recommendations (similar to Amazon.com) without ML expertise.

Forecasting & Other

  • Amazon Forecast – time-series forecasting using ML (demand planning, resource planning).
  • Amazon Fraud Detector – identify potentially fraudulent online activities using ML.
  • Amazon CodeWhisperer (now Amazon Q Developer) – AI-powered code suggestions in IDEs.

Data & Analytics for ML

  • AWS Glue – serverless ETL with built-in ML transforms (FindMatches for deduplication).
  • Amazon Athena ML – run ML inference from SQL queries using SageMaker models.
  • Amazon Redshift ML – create, train, and deploy ML models using SQL (uses SageMaker Autopilot).
  • Amazon Kinesis – real-time data streaming for ML inference on streaming data.
  • AWS Lake Formation – build secure data lakes as training data sources.

Responsible AI

  • Amazon Bedrock Guardrails – content filters, denied topics, PII redaction, hallucination reduction (grounding checks).
  • SageMaker Clarify – pre-training bias detection (CI, DPL, KL metrics) and post-training bias detection (DPPL, DI, AD).
  • SageMaker Model Monitor – continuous monitoring for data quality, model quality, bias drift, and feature attribution drift.
  • Model Explainability – SHAP values for feature importance and individual prediction explanations.
  • Amazon Titan watermarking – invisible watermarks in generated images for content authenticity.
  • AWS AI Service Cards – transparency documentation for AWS AI services.
  • Human-in-the-loop – Amazon Augmented AI (A2I) for human review of ML predictions.

Infrastructure for AI/ML

  • AWS Trainium – custom chip optimized for deep learning training (used in EC2 Trn1 instances).
  • AWS Inferentia – custom chip optimized for inference (used in EC2 Inf2 instances). Up to 40% better price-performance than GPU.
  • Amazon EC2 P5/P4d instances – NVIDIA GPU instances for training and inference.
  • Amazon EC2 G5/G6 instances – GPU instances for graphics and ML inference.
  • AWS Neuron SDK – compile and optimize models for Trainium and Inferentia chips.
  • Amazon S3 – primary storage for training data, model artifacts, and outputs.
  • FSx for Lustre – high-throughput file system for training data (integrates with S3).

Key Concepts for Certification

ML Workflow

  • Data Collection → Data Preparation (cleaning, feature engineering) → Model Training → Evaluation → Deployment → Monitoring

Model Types

  • Supervised Learning – labeled data (classification, regression). Examples: fraud detection, price prediction.
  • Unsupervised Learning – no labels (clustering, anomaly detection). Examples: customer segmentation, topic modeling.
  • Reinforcement Learning – agent learns through rewards (robotics, game playing, recommendations).
  • Foundation Models – large pre-trained models fine-tuned or used via prompting (GPT, Claude, Llama, Titan).

RAG (Retrieval Augmented Generation)

  • Combines a foundation model with external knowledge retrieval to provide accurate, up-to-date, and cited answers.
  • AWS implementation: Bedrock Knowledge Bases + vector database (OpenSearch Serverless, Aurora PostgreSQL, Pinecone).
  • Process: Query → Retrieve relevant chunks from knowledge base → Augment prompt with context → Generate answer.

Prompt Engineering

  • Zero-shot – ask directly without examples.
  • Few-shot – provide examples in the prompt.
  • Chain-of-thought – instruct the model to reason step by step.
  • System prompts – set behavior, persona, and constraints.

AWS Certification Exam Practice Questions

  1. A company wants to build a chatbot that answers questions using their internal documentation stored in S3 and Confluence. The answers must cite sources. Which AWS service and feature combination is most appropriate?
    1. Amazon Lex with Lambda
    2. Amazon Bedrock with Knowledge Bases (RAG)
    3. Amazon Kendra with Lex
    4. Amazon Comprehend with Q Business
  2. A team needs to detect if their ML model exhibits bias against a protected demographic group before deploying to production. Which service should they use?
    1. Amazon Bedrock Guardrails
    2. Amazon Rekognition
    3. SageMaker Clarify
    4. Amazon Comprehend
  3. An application needs to extract structured data (tables, key-value pairs) from scanned invoices and receipts. Which service is purpose-built for this?
    1. Amazon Rekognition
    2. Amazon Comprehend
    3. Amazon Textract
    4. Amazon Bedrock
  4. A generative AI application must prevent the model from discussing competitor products and must redact any PII in responses. Which feature provides these controls?
    1. SageMaker Model Monitor
    2. Amazon Bedrock Guardrails
    3. Amazon Comprehend PII detection
    4. AWS WAF
  5. A company needs the lowest cost per inference for deploying a trained deep learning model at high throughput. Which AWS hardware is optimized for this?
    1. EC2 P5 instances (NVIDIA GPU)
    2. EC2 G5 instances
    3. EC2 Inf2 instances (AWS Inferentia2)
    4. EC2 Trn1 instances (AWS Trainium)

Related Posts

References

Amazon Bedrock User Guide

Amazon SageMaker Developer Guide

Amazon Q Business User Guide

AWS AI/ML Services Overview

AWS Transit Gateway vs VPC Peering vs PrivateLink

AWS Transit Gateway vs VPC Peering vs PrivateLink

  • AWS provides multiple VPC connectivity options, each designed for different network topologies and use cases.
  • VPC Peering is point-to-point, Transit Gateway is a hub for many-to-many connectivity, and PrivateLink is for private service access without network exposure.
  • Choice depends on number of VPCs, routing requirements, security posture, and cost.

Transit Gateway vs VPC Peering vs PrivateLink Comparison

Feature VPC Peering Transit Gateway PrivateLink
Topology Point-to-point (1:1) Hub-and-spoke (many:many) Service endpoint (consumer:provider)
Transitive Routing No Yes No (service access only)
Scale 125 peering connections per VPC 5,000 attachments per TGW Unlimited endpoints
Cross-Region Yes (inter-region peering) Yes (inter-region peering) Yes (with inter-region support)
Cross-Account Yes Yes (RAM sharing) Yes
CIDR Overlap Not allowed Not allowed (per attachment) Allowed (uses ENI in consumer VPC)
Network Exposure Full VPC network visible to peer Full VPC network via route tables Only the service endpoint exposed
Bandwidth No limit (same as inter-AZ) Up to 50 Gbps per attachment Up to 100 Gbps per endpoint
Cost Data transfer only (no hourly charge) Hourly per attachment + data processing Hourly per endpoint + data processing
Use Case Few VPCs, simple connectivity Many VPCs, centralized routing, VPN/DX aggregation Expose service privately, SaaS connectivity, zero-trust
Route Management Update route tables in both VPCs Centralized route tables on TGW No route table changes needed
Security Security groups + NACLs Security groups + NACLs + TGW route tables Minimum exposure (only service port)

When to Choose Which

  • Choose VPC Peering – Small number of VPCs (2-5), simple point-to-point connectivity, lowest cost, no transitive routing needed.
  • Choose Transit Gateway – Many VPCs needing full mesh connectivity, centralized VPN/Direct Connect, shared services VPC, network segmentation with route tables.
  • Choose PrivateLink – Expose a specific service to other accounts/VPCs without full network access, overlapping CIDRs, SaaS service consumption, zero-trust architecture.
  • Combine TGW + PrivateLink – Transit Gateway for general connectivity between VPCs, PrivateLink for specific service access with minimal exposure.

AWS Certification Exam Practice Questions

  1. A company has 50 VPCs that all need to communicate with a shared services VPC and a centralized Direct Connect connection. Which connectivity solution scales best?
    1. VPC Peering (50 connections)
    2. Transit Gateway
    3. PrivateLink
    4. VPN to each VPC
  2. A SaaS provider needs to expose their service to customers in different AWS accounts without exposing their entire VPC network. The customer VPCs have overlapping CIDR ranges. Which solution works?
    1. VPC Peering
    2. Transit Gateway
    3. PrivateLink
    4. Site-to-Site VPN
  3. Two VPCs in the same region need connectivity. The traffic volume is minimal, cost is a priority, and no transitive routing is needed. What is the most cost-effective solution?
    1. Transit Gateway
    2. VPC Peering
    3. PrivateLink
    4. AWS Cloud WAN
  4. An organization needs VPC A to route traffic through VPC B to reach VPC C. Which service supports this transitive routing?
    1. VPC Peering
    2. PrivateLink
    3. Transit Gateway
    4. Internet Gateway

Related Posts

References

AWS Transit Gateway Guide

VPC Peering Guide

AWS PrivateLink Guide

AWS CloudFront vs Global Accelerator

AWS CloudFront vs Global Accelerator

  • Both CloudFront and Global Accelerator use the AWS global edge network to improve performance, but they serve different purposes.
  • CloudFront is a Content Delivery Network (CDN) that caches content at edge locations.
  • Global Accelerator routes traffic over the AWS backbone to the optimal regional endpoint without caching.

CloudFront vs Global Accelerator Comparison

Feature CloudFront Global Accelerator
Purpose Content caching and delivery (CDN) Network traffic acceleration (no caching)
Layer Layer 7 (HTTP/HTTPS/WebSocket) Layer 4 (TCP/UDP)
Caching Yes – caches content at 400+ edge locations No caching – proxies all requests to origin
Static IP No (uses DNS-based routing) Yes – 2 anycast static IPs
IP Whitelisting Difficult (IPs change) Easy (fixed anycast IPs)
Protocols HTTP, HTTPS, WebSocket TCP, UDP
DNS Propagation Affected by DNS TTL during failover Instant failover (no DNS change, same IPs)
Failover Origin failover (primary/secondary) Automatic endpoint failover (<30 seconds)
DDoS Protection AWS Shield Standard (Shield Advanced optional) AWS Shield Standard (Shield Advanced optional)
WAF Integration Yes (AWS WAF) No
Origins/Endpoints S3, ALB, EC2, custom HTTP origins ALB, NLB, EC2, Elastic IP
Client Affinity No (stateless caching) Yes (source IP based)
Best For Static/dynamic web content, APIs, video streaming Gaming, IoT, VoIP, non-HTTP apps needing fixed IPs

When to Choose Which

  • Choose CloudFront – Web applications, static asset delivery, video streaming, API acceleration with caching, need WAF integration.
  • Choose Global Accelerator – Non-HTTP protocols (TCP/UDP gaming, IoT), need static IP for whitelisting, instant failover without DNS propagation, multi-region active-active.
  • Use Both Together – CloudFront for cacheable content + Global Accelerator for the origin endpoint requiring fixed IPs and fast failover.

AWS Certification Exam Practice Questions

  1. A gaming company needs to route UDP traffic to the nearest regional server with sub-30-second failover and static IPs for firewall whitelisting. Which service should they use?
    1. CloudFront
    2. Route 53 latency-based routing
    3. Global Accelerator
    4. ALB with multi-region
  2. A media company wants to serve video content and static assets globally with lowest latency and reduce origin load. Which service is most appropriate?
    1. Global Accelerator
    2. CloudFront
    3. S3 Transfer Acceleration
    4. Route 53 geolocation routing
  3. An application needs both fast failover (no DNS propagation delay) and static anycast IP addresses for a TCP-based service. The content is dynamic and cannot be cached. Which service fits?
    1. CloudFront with cache disabled
    2. Global Accelerator
    3. Route 53 with health checks
    4. NLB with Elastic IPs

Related Posts

References

Amazon CloudFront Developer Guide

AWS Global Accelerator Developer Guide

AWS S3 vs EBS vs EFS vs FSx

📌 Updated Guide Available: For a comprehensive comparison with architecture diagrams and practice questions, see our updated AWS S3 vs EBS vs EFS – Complete Storage Comparison Guide.

This page covers FSx in addition to S3, EBS, and EFS.

AWS S3 vs EBS vs EFS vs FSx

  • AWS offers four primary storage services, each designed for different access patterns and use cases.
  • S3 is object storage, EBS is block storage for EC2, EFS is managed NFS file storage, and FSx is managed file systems for specific workloads (Windows, Lustre, NetApp, OpenZFS).
  • Choice depends on access patterns, performance needs, sharing requirements, and protocol compatibility.

S3 vs EBS vs EFS vs FSx Comparison

Feature S3 EBS EFS FSx
Type Object storage Block storage File storage (NFS) File storage (multiple protocols)
Access HTTP/HTTPS API Attached to single EC2 (multi-attach for io2) Concurrent access from multiple EC2/ECS/Lambda Concurrent access from multiple instances
Protocol REST API, S3 API Block device (no protocol) NFSv4.1 SMB, NFS, Lustre, iSCSI
Max Size Unlimited (5TB per object) 64TB per volume Unlimited (petabyte scale) Varies (up to petabytes)
Durability 99.999999999% (11 nines) 99.999% (within AZ) 99.999999999% (across AZs) 99.999999999% (Multi-AZ option)
Availability Zone Regional (across 3+ AZs) Single AZ Regional (Multi-AZ) Single AZ or Multi-AZ
Performance High throughput, higher latency Low latency (sub-ms for io2) Low latency, scales with file system Sub-ms latency (Lustre/OpenZFS)
Use Case Backup, data lake, static hosting, archive Databases, boot volumes, transactional workloads Shared content, CMS, home dirs, containers HPC, Windows shares, ML training, ONTAP
Pricing Model Per GB stored + requests + transfer Per GB provisioned + IOPS (io2) Per GB used (no provisioning) Per GB provisioned + throughput
Lifecycle/Tiering Yes (Intelligent-Tiering, Glacier) No Yes (EFS IA, Archive) Limited (FSx Lustre S3 integration)
Encryption SSE-S3, SSE-KMS, SSE-C AES-256 (KMS) AES-256 (KMS) AES-256 (KMS)
Backup Versioning, Cross-Region Replication Snapshots (to S3) AWS Backup AWS Backup, automatic backups

Amazon S3

  • Object storage – stores data as objects (key-value) with unlimited capacity.
  • Best for data lakes, backups, static website hosting, media storage, and archive.
  • Multiple storage classes: Standard, IA, One Zone-IA, Intelligent-Tiering, Glacier Instant/Flexible/Deep Archive.
  • Not a file system – cannot be mounted directly (use S3 Mountpoint for read-heavy workloads).
  • Supports event notifications to Lambda, SQS, SNS, EventBridge for event-driven processing.

Amazon EBS

  • Block-level storage designed for single EC2 instance attachment (io2 supports multi-attach).
  • Best for databases, boot volumes, and applications requiring low-latency block access.
  • Volume types: gp3 (general purpose), io2 Block Express (high IOPS), st1 (throughput), sc1 (cold).
  • Single AZ – volume and instance must be in the same AZ; use snapshots for cross-AZ/region copies.
  • Supports live volume resizing and type changes without downtime.

Amazon EFS

  • Fully managed NFS file system – multiple EC2, ECS, and Lambda can access simultaneously.
  • Best for shared content repositories, CMS, home directories, container storage, and ML training data.
  • Elastic – automatically grows and shrinks; pay only for storage used.
  • Performance modes: General Purpose (latency-sensitive) and Max I/O (high throughput).
  • EFS Infrequent Access and Archive tiers reduce costs for rarely accessed files.
  • Supports cross-region replication for DR.

Amazon FSx

  • Managed file systems for specialized workloads – four options available.
  • FSx for Windows File Server – fully managed Windows-native (SMB) with Active Directory integration.
  • FSx for Lustre – high-performance parallel file system for HPC, ML training; integrates with S3.
  • FSx for NetApp ONTAP – multi-protocol (NFS, SMB, iSCSI) with NetApp features (SnapMirror, FlexClone).
  • FSx for OpenZFS – high-performance NFS with snapshots, cloning, and data compression.

When to Choose Which

  • Choose S3 – Unstructured data, backups, data lake, web assets, archive, serverless data processing.
  • Choose EBS – Database storage, single-instance applications requiring low-latency block I/O.
  • Choose EFS – Shared Linux file system, containers needing shared storage, Lambda file access.
  • Choose FSx for Windows – Windows applications, SMB shares, Active Directory integration.
  • Choose FSx for Lustre – HPC, ML training, video processing needing sub-ms latency with S3 integration.
  • Choose FSx for ONTAP – Multi-protocol access, hybrid cloud, applications needing NetApp features.

AWS Certification Exam Practice Questions

  1. A web application running on multiple EC2 instances across AZs needs shared access to uploaded user files. Which storage service is most appropriate?
    1. S3 with Mountpoint
    2. EBS Multi-Attach
    3. EFS
    4. FSx for OpenZFS
  2. A database workload requires consistent sub-millisecond latency with 64,000 IOPS on a single EC2 instance. Which storage should be used?
    1. EFS Max I/O mode
    2. S3 Express One Zone
    3. EBS io2 Block Express
    4. FSx for Lustre
  3. A company needs to migrate Windows file shares with Active Directory permissions to AWS. Which service maintains full compatibility?
    1. EFS
    2. S3
    3. FSx for OpenZFS
    4. FSx for Windows File Server
  4. An ML training job needs to process a 50TB dataset stored in S3 with the highest possible throughput. Which storage approach minimizes training time?
    1. Copy data to EBS gp3
    2. Access directly from S3
    3. FSx for Lustre linked to S3 bucket
    4. Copy to EFS

Related Posts

📖 Related: AWS S3 vs EBS vs EFS – Complete Storage Comparison Guide

References

Amazon S3 User Guide

Amazon EBS User Guide

Amazon EFS User Guide

Amazon FSx for Windows File Server User Guide

AWS Lambda vs Fargate vs App Runner

AWS Lambda vs Fargate vs App Runner

  • AWS offers multiple serverless/managed compute options for running application code without managing servers.
  • Lambda is for event-driven functions, Fargate is for containerized workloads, and App Runner is for web applications and APIs with zero configuration.
  • All three eliminate server management but differ in execution model, duration limits, and use cases.

Lambda vs Fargate vs App Runner Comparison

Feature Lambda Fargate App Runner
Execution Model Event-driven functions Long-running containers Always-running web service
Max Duration 15 minutes Unlimited Unlimited
Scale to Zero Yes (no charge when idle) No (minimum 1 task running) Yes (pause instances when no traffic)
Cold Start Yes (mitigated with Provisioned Concurrency) Container startup time (seconds) Minimal (keeps warm instances)
Memory 128MB – 10GB 512MB – 120GB 512MB – 12GB
vCPU Proportional to memory (up to 6 vCPU) 0.25 – 16 vCPU 0.25 – 4 vCPU
Deployment ZIP or container image Container image Source code (GitHub) or container image
Auto Scaling Automatic per-request concurrency Task-level with ECS/EKS Auto Scaling Automatic based on concurrent requests
Networking Optional VPC access Full VPC integration VPC Connector (optional)
Pricing Per request + per GB-second Per vCPU/hour + per GB/hour Per vCPU/hour + per GB/hour (pause charge lower)
Configuration Moderate (triggers, IAM, layers) High (task definitions, clusters, services) Minimal (source → running service)
Load Balancer Not needed (API Gateway or Function URL) ALB/NLB required Built-in (managed HTTPS endpoint)
Custom Runtime Yes (custom runtime or container) Any container Limited runtimes (Python, Node, Java, Go, .NET, Ruby) or container

AWS Lambda

  • Event-driven, function-as-a-service – runs code in response to events (S3, API Gateway, SQS, DynamoDB, etc.).
  • Scales automatically to thousands of concurrent executions per second.
  • Pay only for execution time – billed per millisecond with a generous free tier (1M requests/month).
  • 15-minute maximum execution – not suitable for long-running processes.
  • Supports Provisioned Concurrency to eliminate cold starts for latency-sensitive workloads.
  • Lambda@Edge and CloudFront Functions for edge computing.
  • Best for: event processing, API backends, data transformations, scheduled tasks, and glue logic.

AWS Fargate

  • Serverless compute for containers – runs Docker containers without managing EC2 instances.
  • Works with ECS or EKS as the orchestration layer.
  • No duration limit – suitable for long-running services, background workers, batch jobs.
  • Full VPC networking – each task gets its own ENI with security group control.
  • Supports persistent storage via EFS for shared file systems.
  • Fargate Spot for up to 70% savings on fault-tolerant workloads.
  • Best for: microservices, APIs needing persistent connections, background processing, and containerized applications.

AWS App Runner

  • Fully managed service – goes from source code or container to running web service in minutes.
  • Zero infrastructure configuration – no load balancer, no cluster, no task definition to manage.
  • Provides a managed HTTPS endpoint with automatic TLS certificate.
  • Auto-deploys from GitHub repository or ECR on code push.
  • Can pause instances when no traffic – lower cost than Fargate minimum.
  • VPC Connector for private resource access (RDS, ElastiCache, etc.).
  • Best for: web applications, REST APIs, and teams that want the simplest deployment experience.

When to Choose Which

  • Choose Lambda – Short-lived event processing (<15 min), API backends with variable traffic, integrations between AWS services, cost optimization for sporadic workloads.
  • Choose Fargate – Long-running containers, persistent connections (WebSocket, gRPC), complex multi-container applications, need full ECS/EKS ecosystem.
  • Choose App Runner – Simple web apps/APIs, want fastest time-to-deploy, team unfamiliar with containers/orchestration, predictable HTTP request-response workloads.

AWS Certification Exam Practice Questions

  1. A startup needs to deploy a REST API that handles unpredictable traffic spikes (0 to thousands of requests per second) and they want to pay nothing during idle periods. Which service is most cost-effective?
    1. App Runner
    2. Fargate with ECS
    3. Lambda with API Gateway
    4. EC2 with Auto Scaling
  2. A team needs to run a containerized web application that maintains WebSocket connections and requires persistent EFS storage. Which compute option supports this?
    1. Lambda
    2. Fargate with ECS
    3. App Runner
    4. Lambda with container image
  3. A developer wants to deploy a Python web application directly from a GitHub repository with automatic HTTPS, auto-scaling, and zero infrastructure management. Which service requires the least configuration?
    1. Lambda with API Gateway
    2. Fargate with ALB
    3. App Runner
    4. Elastic Beanstalk

Related Posts

References

AWS Lambda Developer Guide

AWS Fargate Documentation

AWS App Runner Developer Guide

AWS Aurora vs RDS – Performance & Cost Comparison

AWS Aurora vs RDS – MySQL & PostgreSQL

  • Both Amazon Aurora and Amazon RDS provide managed relational database services, but Aurora is AWS’s cloud-native redesign with significantly different architecture.
  • Aurora is compatible with MySQL and PostgreSQL but delivers up to 5x throughput of MySQL and 3x of PostgreSQL on the same hardware.
  • Choice depends on performance requirements, cost tolerance, and need for advanced features like global databases or serverless scaling.

Aurora vs RDS Comparison

Feature Amazon Aurora Amazon RDS (MySQL/PostgreSQL)
Architecture Cloud-native, distributed storage (6 copies across 3 AZs) Traditional architecture with EBS-based storage
Performance 5x MySQL, 3x PostgreSQL throughput Standard MySQL/PostgreSQL performance
Storage Auto-scales 10GB to 128TB, no pre-provisioning Provision up to 64TB (gp3/io1/io2)
Replication Up to 15 read replicas, millisecond lag Up to 15 read replicas, seconds to minutes lag
Failover <30 seconds (shared storage, no data sync needed) 60-120 seconds (Multi-AZ DNS failover)
Multi-AZ Built-in (storage spans 3 AZs by default) Synchronous standby in separate AZ
Global Database Yes – cross-region replication <1 second lag Cross-region read replicas (minutes lag)
Serverless Aurora Serverless v2 (scales to 0 ACU, instant scaling) Not available
Backtrack Yes – rewind DB to any point in seconds (MySQL only) Not available (use point-in-time restore)
Cloning Fast clone using copy-on-write (seconds, no storage cost initially) Snapshot restore (minutes to hours)
Blue/Green Deployments Yes Yes
Cost ~20-30% more than RDS for same instance size Lower base cost
I/O Cost Standard (pay per I/O) or I/O-Optimized (included) Included in storage (gp3) or provisioned (io1/io2)
Max Connections Higher (optimized connection handling) Based on instance memory
Engines MySQL-compatible, PostgreSQL-compatible only MySQL, PostgreSQL, MariaDB, Oracle, SQL Server

When to Choose Aurora

  • High availability is critical – built-in 6-way replication across 3 AZs, <30s failover.
  • Read-heavy workloads – up to 15 read replicas with millisecond replication lag.
  • Variable workloads – Aurora Serverless v2 scales compute automatically (even to zero).
  • Global applications – Aurora Global Database provides <1 second cross-region replication.
  • Development/testing – fast cloning creates copies in seconds without additional storage cost.
  • Need to undo mistakes quickly – Backtrack rewinds the database without restoring from backup.

When to Choose RDS

  • Cost-sensitive workloads – 20-30% cheaper for equivalent instance sizes.
  • Non-MySQL/PostgreSQL engines – need Oracle, SQL Server, or MariaDB.
  • Simple workloads – don’t need Aurora’s advanced features (global DB, serverless, cloning).
  • Lift-and-shift migrations – exact MySQL/PostgreSQL compatibility without Aurora-specific behavior.
  • Predictable I/O costs – gp3 storage includes I/O in the storage price.

AWS Certification Exam Practice Questions

  1. A company needs a database that automatically scales storage and provides sub-second failover with no data loss. Which service meets these requirements?
    1. RDS MySQL with Multi-AZ
    2. Amazon Aurora
    3. RDS PostgreSQL with read replicas
    4. DynamoDB
  2. A developer accidentally ran a DELETE query on a production Aurora MySQL database 5 minutes ago. What is the fastest recovery method?
    1. Restore from automated backup
    2. Point-in-time recovery
    3. Aurora Backtrack
    4. Promote a read replica
  3. A global application needs a relational database with cross-region read access and less than 1 second replication lag for disaster recovery. Which solution is appropriate?
    1. RDS with cross-region read replicas
    2. Aurora Global Database
    3. DynamoDB Global Tables
    4. RDS Multi-AZ with manual failover
  4. A startup has unpredictable traffic – sometimes zero users, sometimes thousands. They need a relational database that scales to zero during idle periods to minimize costs. What should they use?
    1. RDS with Scheduled Scaling
    2. Aurora Provisioned with Auto Scaling
    3. Aurora Serverless v2
    4. DynamoDB On-Demand

Related Posts

References

Amazon Aurora User Guide

Amazon RDS User Guide

ECS vs EKS vs Fargate – Container Services Compared

AWS ECS vs EKS vs Fargate – Container Services Compared

AWS offers three primary container services — Amazon ECS, Amazon EKS, and AWS Fargate — each solving container orchestration differently. Understanding the architecture, pricing, and operational trade-offs is essential for the AWS Solutions Architect and DevOps certification exams and for making real-world architectural decisions. This comprehensive comparison covers architecture differences, use cases, pricing models, scaling, networking, security, monitoring, and guidance on when to choose each service.

Quick Overview

  • Amazon ECS (Elastic Container Service) — AWS-native container orchestration service with zero control plane cost. Tightly integrated with AWS services. Uses Task Definitions to define containers.
  • Amazon EKS (Elastic Kubernetes Service) — Managed Kubernetes service running upstream, CNCF-conformant Kubernetes. Provides full Kubernetes API compatibility and ecosystem access.
  • AWS Fargate — Serverless compute engine for containers (not an orchestrator). Works as a launch type for both ECS and EKS, eliminating node/instance management.

Key distinction: ECS and EKS are orchestrators (they schedule and manage containers). Fargate is a compute engine (it runs the containers). You choose ECS or EKS as your orchestrator, then choose Fargate or EC2 as your compute layer.

Architecture Differences

Amazon ECS Architecture

  • AWS-proprietary orchestration engine — not based on Kubernetes.
  • Cluster → Service → Task → Container hierarchy.
  • Task Definition — JSON blueprint specifying container images, CPU/memory, networking mode, volumes, and IAM roles.
  • Service — Maintains desired count of tasks, handles rolling deployments, integrates with load balancers.
  • Capacity Providers — Abstract compute capacity (Fargate, Fargate Spot, EC2 Auto Scaling Groups).
  • ECS Agent — Runs on EC2 instances (EC2 launch type) to communicate with the ECS control plane.
  • ECS Express Mode (GA Nov 2025) — Simplifies deployment to just a container image + two IAM roles. Automatically provisions ALB, auto scaling, networking, and monitoring with best-practice defaults.
  • ECS Service Connect — Built-in service mesh providing service discovery, traffic management, and observability without sidecar configuration.
  • Control plane is fully managed and free — no cluster fee.

Amazon EKS Architecture

  • Runs upstream, unmodified Kubernetes — passes CNCF conformance tests.
  • Control Plane — AWS-managed (etcd, API server, scheduler, controller-manager) across 3 AZs. Costs $0.10/hour ($73/month).
  • Data Plane options:
    • Managed Node Groups — AWS provisions and manages EC2 instances; you control instance types and scaling.
    • Self-Managed Nodes — Full control over EC2 instances (custom AMIs, GPU, Windows).
    • Fargate — Serverless pods; each pod runs in its own micro-VM.
    • EKS Auto Mode (GA Dec 2024) — Fully automates compute, storage, and networking. Selects optimal instances, scales dynamically, patches OS, manages add-ons.
  • Full Kubernetes ecosystem: Helm charts, Operators, CRDs, service meshes (Istio, Linkerd), GitOps (ArgoCD, Flux).
  • EKS Pod Identity — Simplified IAM integration for pods (replaces IRSA complexity).
  • Extended Support — Run older K8s versions for 12 extra months at $0.60/cluster/hour.

AWS Fargate Architecture

  • Serverless compute engine — AWS manages all underlying infrastructure (no EC2 instances to provision, patch, or scale).
  • Each task (ECS) or pod (EKS) runs in an isolated Firecracker micro-VM — hardware-level isolation between tenants.
  • You specify vCPU and memory per task/pod; Fargate provisions exactly that capacity.
  • Supports Linux and Windows containers (Windows on ECS Fargate GA).
  • Ephemeral storage: 20 GB free, expandable to 200 GB.
  • No SSH/exec into underlying host — container-level access only.
  • Integrates with both ECS and EKS as a capacity provider / Fargate profile.

Detailed Comparison Table

Feature Amazon ECS Amazon EKS AWS Fargate
Type Container orchestrator Container orchestrator (Kubernetes) Serverless compute engine
Control Plane Cost Free ($0) $0.10/hour (~$73/month per cluster) N/A (uses ECS or EKS control plane)
Compute Pricing EC2 instance costs or Fargate per-task pricing EC2 instance costs, Fargate, or EKS Auto Mode $0.04048/vCPU-hour + $0.004445/GB-hour
Kubernetes Compatible No (AWS-proprietary) Yes (CNCF-conformant upstream K8s) N/A (compute layer)
Multi-Cloud Portability No (AWS only) Yes (K8s workloads portable to GKE, AKS, on-premises) No (AWS only)
Learning Curve Low — simpler concepts High — requires Kubernetes expertise Lowest — no infrastructure to manage
Scaling ECS Service Auto Scaling (target tracking, step, scheduled, predictive) HPA, VPA, Karpenter, Cluster Autoscaler, EKS Auto Mode Automatic — scales with task/pod count
Cold Start Minimal (EC2), ~30-60s (Fargate) Minimal (EC2/Auto Mode), ~60-90s (Fargate) 30-90 seconds per task/pod
Networking awsvpc (ENI per task), bridge, host modes VPC CNI (ENI per pod), Calico, Cilium awsvpc only (ENI per task/pod)
Service Mesh ECS Service Connect (built-in) Istio, Linkerd, VPC Lattice Inherits from ECS/EKS
IAM Integration Task Roles (per task), Execution Roles EKS Pod Identity, IRSA Same as ECS/EKS (Task Roles or Pod Identity)
Monitoring CloudWatch Container Insights, X-Ray CloudWatch, Prometheus, Grafana, Datadog CloudWatch Container Insights
Deployment Strategies Rolling, Blue/Green (CodeDeploy), Canary (Express Mode) Rolling, Blue/Green, Canary (Argo Rollouts, Flagger) Inherits from ECS/EKS
GPU Support Yes (EC2 launch type) Yes (EC2, Auto Mode) No
Windows Containers Yes (EC2 and Fargate) Yes (EC2 managed node groups) Yes (ECS on Fargate only)
Spot/Savings Fargate Spot (up to 70% off), EC2 Spot EC2 Spot (Karpenter), Savings Plans Fargate Spot (up to 70% off), Compute Savings Plans (up to 52%)
Ecosystem AWS-native integrations Full CNCF/K8s ecosystem (Helm, Operators, CRDs) N/A (compute layer)

Pricing Models

Amazon ECS Pricing

  • Control plane: Free — no charge for using ECS itself.
  • EC2 launch type: Pay standard EC2 pricing for instances in your cluster. You manage capacity and utilization.
  • Fargate launch type: Pay per-task based on vCPU and memory requested (see Fargate pricing below).
  • Cost optimization: Use Capacity Providers with managed scaling for EC2; mix Fargate and Fargate Spot for serverless workloads.

Amazon EKS Pricing

  • Control plane: $0.10/hour per cluster (~$73/month) — standard support.
  • Extended support: $0.60/hour per cluster for Kubernetes versions past end-of-standard-support.
  • EKS Auto Mode: Compute charged per second (EC2 equivalent rates) with automatic instance selection and consolidation. Additional $0.10/hour cluster fee applies.
  • Data plane (EC2): Standard EC2 instance pricing. Use Karpenter + Spot for 60-90% savings.
  • Data plane (Fargate): Same Fargate per-pod pricing as ECS + cluster fee overhead.
  • EKS Anywhere: $24,000/cluster/year (1-year) or $18,000/cluster/year (3-year) for on-premises.

AWS Fargate Pricing

  • On-Demand: $0.04048 per vCPU per hour + $0.004445 per GB memory per hour (US East).
  • Fargate Spot: Up to 70% discount; tasks can be interrupted with 30-second warning.
  • Compute Savings Plans: Up to 52% discount with 1-year or 3-year commitment (applies to Fargate and EC2).
  • Ephemeral storage: $0.000111 per GB per hour beyond the free 20 GB.
  • Billing granularity: Per-second with 1-minute minimum.
  • Cost example: A task with 1 vCPU + 2 GB memory running 24/7 costs ~$36/month (On-Demand).

Scaling Approaches

ECS Scaling

  • Service Auto Scaling — Target tracking (CPU/memory utilization), step scaling, scheduled scaling, and predictive scaling (uses ML to anticipate traffic patterns).
  • Cluster Auto Scaling — Capacity Providers automatically add/remove EC2 instances based on pending task demand.
  • High-resolution metrics (2026) — 10-second granularity metrics enable faster scaling decisions.
  • Scales from 0 tasks (with scheduled scaling or EventBridge triggers).

EKS Scaling

  • Horizontal Pod Autoscaler (HPA) — Scales pod count based on CPU, memory, or custom metrics.
  • Vertical Pod Autoscaler (VPA) — Adjusts resource requests/limits per pod.
  • Karpenter — Fast, intelligent node provisioning (provisions right-sized instances in seconds, consolidates underutilized nodes).
  • EKS Auto Mode — Combines Karpenter-like provisioning with AWS-managed lifecycle. Automatic consolidation, Spot diversification, and right-sizing.
  • KEDA — Event-driven autoscaling (scale on queue depth, custom metrics, etc.).

Fargate Scaling

  • No node scaling needed — capacity is provisioned per task/pod automatically.
  • Scaling is limited by task/pod launch speed (30-90 seconds cold start).
  • For rapid scaling, pre-warm with minimum task counts or use EC2 launch type.
  • Account-level Fargate quotas may limit burst scaling (default 500 on-demand tasks per region).

Networking

ECS Networking

  • awsvpc mode (recommended) — Each task gets its own ENI with a private IP in your VPC. Full security group control per task.
  • bridge mode — Docker bridge networking; multiple tasks share the host’s ENI. Port mapping required.
  • host mode — Tasks use the host’s network namespace directly. Best performance, no port mapping isolation.
  • ECS Service Connect — Managed service mesh providing DNS-based service discovery, load balancing, retries, and circuit breaking between ECS services.
  • Load balancing: ALB, NLB integration with dynamic port mapping. Express Mode auto-provisions ALB with HTTPS.

EKS Networking

  • Amazon VPC CNI plugin — Each pod gets a real VPC IP address (ENI-attached). Enables direct pod-to-pod and pod-to-AWS-service communication without overlay networks.
  • Prefix delegation — Assigns /28 prefixes to ENIs for higher pod density per node.
  • Network Policies — Enforce pod-to-pod traffic rules (Calico, Cilium, or VPC CNI network policy).
  • Service types: ClusterIP, NodePort, LoadBalancer (ALB/NLB via AWS Load Balancer Controller).
  • Ingress: AWS ALB Ingress Controller, Nginx, Traefik, Istio Gateway.
  • VPC Lattice — Application-layer service-to-service networking across VPCs and accounts.

Fargate Networking

  • Always uses awsvpc mode — each task/pod gets its own ENI.
  • Each Fargate task runs in an isolated environment; no shared networking with other tasks.
  • Security groups are applied at the task/pod level for fine-grained control.
  • Supports VPC endpoints (PrivateLink) for private connectivity to AWS services.
  • No public IP by default — use NAT Gateway or VPC endpoints for outbound internet access.

Security

ECS Security

  • Task IAM Roles — Fine-grained permissions per task (each task assumes its own IAM role).
  • Task Execution Role — Permissions for the ECS agent to pull images and write logs.
  • Security Groups — Per-task network isolation (awsvpc mode).
  • Secrets Management — Native integration with AWS Secrets Manager and SSM Parameter Store (injected as environment variables).
  • Image scanning — Amazon ECR image scanning (Basic + Enhanced with Inspector).
  • Runtime monitoring — Amazon GuardDuty Runtime Monitoring for ECS detects container-level threats.

EKS Security

  • EKS Pod Identity (recommended) — Simplified IAM role assignment per pod without OIDC provider complexity.
  • IRSA (IAM Roles for Service Accounts) — Legacy approach using OIDC federation.
  • Kubernetes RBAC — Fine-grained access control within the cluster (roles, cluster roles, bindings).
  • Network Policies — Pod-level firewall rules (deny-all by default with explicit allows).
  • Pod Security Standards — Enforce baseline or restricted security profiles (replaced PodSecurityPolicies).
  • Secrets encryption — KMS envelope encryption for etcd secrets.
  • GuardDuty EKS Protection — Monitors control plane audit logs and runtime behavior for threats.
  • EKS Auto Mode security — Automated OS patching, locked-down node configuration, managed security groups.

Fargate Security

  • Micro-VM isolation — Each task/pod runs in a dedicated Firecracker micro-VM. Strongest isolation model (hardware-level).
  • No host access — Cannot SSH into underlying infrastructure; eliminates node-level attack surface.
  • Automated patching — AWS manages the underlying kernel and runtime; no OS patching burden.
  • Ephemeral — No persistent host means no long-lived compromised instances.
  • Compliance: SOC, PCI, HIPAA, ISO eligible. Fargate’s isolation model simplifies compliance boundary definition.

Monitoring and Observability

  • ECS: CloudWatch Container Insights (CPU, memory, network, storage metrics per task/service/cluster), AWS X-Ray for distributed tracing, CloudWatch Logs (awslogs driver), ECS Service Connect metrics for service-to-service observability.
  • EKS: CloudWatch Container Insights (with enhanced observability for EKS), Amazon Managed Prometheus + Amazon Managed Grafana (CNCF-native stack), Kubernetes Metrics Server (HPA), OpenTelemetry Collector, third-party tools (Datadog, New Relic, Dynatrace via operators).
  • Fargate: CloudWatch Container Insights, CloudWatch Logs (built-in log router using Fluent Bit — no sidecar needed on ECS; sidecar required on EKS). No host-level metrics (by design). FireLens for advanced log routing.

When to Choose Each — Decision Guidance

Choose Amazon ECS When:

  • Your team is AWS-centric and does not need Kubernetes portability.
  • You want the simplest container orchestration with zero control plane cost.
  • You have fewer than ~15 microservices and want fast time-to-production.
  • You want deep, native AWS integrations without plugins or add-ons.
  • Budget is constrained — $0/month for orchestration vs $73/month for EKS.
  • You want ECS Express Mode for near-instant production deployments.
  • Team does not have Kubernetes expertise and hiring/training isn’t justified.

Choose Amazon EKS When:

  • Your organization has existing Kubernetes expertise or CNCF tooling investments.
  • You need multi-cloud or hybrid portability — workloads must run on AWS, GCP, Azure, or on-premises.
  • You need the full Kubernetes ecosystem — Helm, Operators, CRDs, Istio, ArgoCD, Crossplane.
  • You’re running complex, large-scale microservices (50+ services) requiring advanced traffic management.
  • You need custom controllers or want to extend the platform with CRDs.
  • You have regulatory requirements mandating Kubernetes (some compliance frameworks specifically audit K8s).
  • Consider EKS Auto Mode to get Kubernetes benefits with significantly reduced operational overhead.

Choose AWS Fargate When:

  • You want to eliminate infrastructure management completely — no patching, no capacity planning, no node scaling.
  • Workloads are bursty or unpredictable — pay only for actual compute consumed.
  • Running batch jobs, scheduled tasks, or short-lived workloads where provisioning instances is wasteful.
  • Team is small and operational overhead must be minimized.
  • You need the strongest isolation model (micro-VM per task) for compliance or security.
  • Not ideal for: GPU workloads, extremely cost-sensitive steady-state workloads (EC2 is cheaper at high utilization), or latency-sensitive apps that cannot tolerate 30-90s cold starts.

Decision Flowchart

START → Do you need Kubernetes API/ecosystem?

  ├── YES → Do you want AWS to manage nodes?

  │   ├── YES, fully → EKS + Fargate (serverless pods)

  │   ├── YES, mostly → EKS Auto Mode (automated EC2 lifecycle)

  │   └── NO, I want control → EKS + Managed Node Groups (+ Karpenter)

  └── NO → Do you want to manage EC2 instances?

      ├── NO → ECS + Fargate (simplest serverless containers)

      └── YES (cost optimization/GPU) → ECS + EC2 (maximum cost control)

Common Use Cases

Use Case Recommended Service Reason
Small team, 3-10 microservices, AWS only ECS + Fargate Zero ops overhead, no control plane cost, fast deployment
Large platform team, 50+ services, multi-cloud EKS + Managed Node Groups Full K8s ecosystem, portability, advanced orchestration
ML/AI training with GPU requirements EKS + EC2 (GPU instances) GPU support, Karpenter for mixed instance scheduling
Batch processing / ETL jobs ECS + Fargate Spot Pay only during execution, up to 70% savings with Spot
Kubernetes migration from on-premises EKS (+ EKS Anywhere for hybrid) Compatible K8s API, reuse existing manifests/Helm charts
Startup prototyping / MVP deployment ECS Express Mode Container image → production in seconds, zero config
Compliance-heavy regulated workloads ECS/EKS + Fargate Micro-VM isolation simplifies compliance boundary
Cost-optimized steady-state workloads ECS/EKS + EC2 Spot + Savings Plans Up to 90% savings vs Fargate On-Demand

AWS Certification Exam Tips

  • SAA-C03 / SAP-C02: Understand that Fargate is a launch type (not an orchestrator). Know when ECS vs EKS is appropriate based on portability and complexity requirements.
  • DevOps Professional (DOP-C02): Know ECS deployment strategies (rolling, blue/green with CodeDeploy) and EKS deployment approaches (ArgoCD, Flux, Argo Rollouts).
  • Specialty certifications: Security questions often test Fargate’s isolation model and task role permissions.
  • Exam questions asking about “simplest” or “least operational overhead” typically point to Fargate. Questions about “portability” or “Kubernetes” point to EKS.
  • If a question mentions cost-conscious steady-state workloads, EC2 launch type with Spot is typically the answer over Fargate.

Practice Questions

Question 1

A company is migrating a containerized application to AWS. The development team has Kubernetes expertise and uses Helm charts and Argo CD for deployments. They require the ability to run the same workloads on Azure in the future for disaster recovery. Which solution meets these requirements?

  1. Amazon ECS with Fargate launch type
  2. Amazon EKS with managed node groups
  3. Amazon ECS with EC2 launch type
  4. AWS Lambda with container image support
Show Answer

Answer: B – Amazon EKS runs upstream Kubernetes, providing compatibility with Helm, ArgoCD, and portability to other Kubernetes platforms (AKS on Azure). ECS is AWS-proprietary and not portable.

Question 2

A startup needs to deploy a containerized web application with minimal operational overhead. The team has no Kubernetes experience and wants to avoid managing any infrastructure. The application has unpredictable traffic patterns. Which architecture is MOST suitable?

  1. Amazon EKS with self-managed node groups
  2. Amazon ECS with EC2 launch type and Cluster Auto Scaling
  3. Amazon ECS with Fargate launch type
  4. Amazon EKS with Fargate profiles
Show Answer

Answer: C – ECS + Fargate provides the simplest container deployment with no infrastructure management, no K8s expertise required, and automatic scaling for unpredictable traffic. EKS adds unnecessary complexity for a team without Kubernetes skills.

Question 3

A company runs 200 microservices on Amazon EKS. They want to reduce the operational burden of managing EC2 instances, patching AMIs, and handling node scaling — while maintaining full Kubernetes API compatibility and access to Helm and custom controllers. Which approach should they use?

  1. Migrate all services to Amazon ECS with Fargate
  2. Use EKS Auto Mode
  3. Use EKS with Fargate profiles for all pods
  4. Use EKS with self-managed nodes and Systems Manager for patching
Show Answer

Answer: B – EKS Auto Mode automates compute provisioning, scaling, OS patching, and cost optimization while maintaining full Kubernetes API compatibility including Helm and custom controllers. Fargate profiles would limit functionality (no DaemonSets, limited storage), and ECS migration loses Kubernetes ecosystem benefits.

Question 4

A financial services company must run containers in an environment where each workload is isolated at the hardware level for regulatory compliance. They need the STRONGEST isolation between containers. Which compute option provides this?

  1. ECS with EC2 launch type using Docker bridge networking
  2. EKS with managed node groups and Pod Security Standards
  3. ECS or EKS with AWS Fargate
  4. EKS with self-managed nodes and gVisor runtime
Show Answer

Answer: C – AWS Fargate runs each task/pod in a dedicated Firecracker micro-VM, providing hardware-level isolation between workloads. This is the strongest isolation model available, stronger than container-level isolation on shared EC2 instances.

Question 5

A company runs steady-state containerized workloads (constant 80% CPU utilization, 24/7) on AWS. They want to minimize container compute costs. The workloads are fault-tolerant and can handle interruptions. Which combination provides the LOWEST cost?

  1. ECS with Fargate Spot
  2. ECS with EC2 Spot Instances and Compute Savings Plans
  3. EKS with Fargate and Compute Savings Plans
  4. ECS with Fargate On-Demand and Compute Savings Plans
Show Answer

Answer: B – For steady-state, high-utilization, fault-tolerant workloads, EC2 Spot instances provide the lowest per-unit compute cost (up to 90% off On-Demand). Combining with Savings Plans for the baseline provides additional savings. Fargate carries a ~3x premium over well-utilized EC2 Spot instances.

Frequently Asked Questions

What is the difference between ECS and EKS?

ECS is AWS’s proprietary container orchestration service that’s simpler to set up, while EKS is a managed Kubernetes service offering full Kubernetes API compatibility and portability across clouds.

When should I use Fargate vs EC2 launch type?

Use Fargate for serverless workloads where you don’t want to manage infrastructure, and EC2 launch type when you need GPU instances, greater cost control, or specific instance types.

Is EKS more expensive than ECS?

EKS charges $0.10/hour per cluster ($73/month) for the control plane plus compute costs, while ECS has no control plane fee. However, total cost depends on workload size and whether you use Fargate or EC2.

References

AWS SQS vs SNS vs EventBridge

AWS SQS vs SNS vs EventBridge

  • AWS provides multiple messaging and event-driven services for decoupling application components.
  • SQS is a message queue for point-to-point communication, SNS is a pub/sub notification service, and EventBridge is a serverless event bus for event-driven architectures.
  • These services are often used together but serve different purposes.

SQS vs SNS vs EventBridge Comparison

Feature SQS SNS EventBridge
Pattern Queue (point-to-point) Pub/Sub (fan-out) Event Bus (event-driven)
Delivery Pull-based (consumers poll) Push-based (pushes to subscribers) Push-based (routes to targets)
Consumers Single consumer per message Multiple subscribers Multiple targets per rule
Filtering No native filtering Message attribute filtering Content-based filtering (event patterns)
Retention 1 min to 14 days (default 4 days) No retention (immediate delivery) No retention (replay via archive up to indefinite)
Ordering FIFO queue guarantees order FIFO topic with SQS FIFO No ordering guarantee
Throughput Standard: unlimited; FIFO: 3,000 msg/sec (batching) Standard: unlimited; FIFO: 300 msg/sec Default: varies by region, scalable
Dead Letter Queue Yes Yes (for failed deliveries) Yes (DLQ on target failures)
Targets/Subscribers Consumer applications SQS, Lambda, HTTP/S, Email, SMS, Kinesis Firehose 200+ AWS services, APIs, SaaS apps
Event Sources Producers send messages Producers publish messages 90+ AWS services, custom apps, SaaS partners
Schema No schema enforcement No schema enforcement Schema Registry with discovery
Replay No (message deleted after processing) No Yes (Event Archive and Replay)
Cross-account Yes (resource policy) Yes (resource policy) Yes (cross-account event bus)
Scheduling Delay queues (up to 15 min) No Yes (EventBridge Scheduler)

Amazon SQS – Simple Queue Service

  • Fully managed message queue for decoupling producers from consumers.
  • Standard Queue – at-least-once delivery, best-effort ordering, unlimited throughput.
  • FIFO Queue – exactly-once processing, strict ordering, up to 3,000 msg/sec with batching.
  • Messages are retained up to 14 days – acts as a buffer for traffic spikes.
  • Supports visibility timeout to prevent multiple consumers processing the same message.
  • Supports long polling to reduce empty receives and costs.
  • Dead Letter Queue (DLQ) for messages that fail processing after max retries.
  • Integrates natively with Lambda (event source mapping) for serverless processing.

Amazon SNS – Simple Notification Service

  • Fully managed pub/sub service for fan-out messaging to multiple subscribers.
  • A single message published to a topic is delivered to all subscribers simultaneously.
  • Supports multiple protocols – SQS, Lambda, HTTP/S, Email, SMS, Kinesis Data Firehose, mobile push.
  • Message filtering – subscribers can set filter policies on message attributes to receive only relevant messages.
  • FIFO topics – strict ordering and deduplication when paired with SQS FIFO queues.
  • Fan-out pattern – SNS + multiple SQS queues for parallel processing of the same event.
  • Supports message encryption (SSE-KMS) and cross-account subscriptions.

Amazon EventBridge

  • Serverless event bus for building event-driven architectures at scale.
  • Receives events from 90+ AWS services automatically (no configuration needed).
  • Content-based filtering with event patterns – filter on any field in the event JSON body.
  • Routes events to 200+ AWS service targets including Lambda, Step Functions, API Gateway, SQS, SNS.
  • Schema Registry – automatically discovers and stores event schemas for code generation.
  • Event Archive and Replay – store events indefinitely and replay them for debugging or reprocessing.
  • EventBridge Scheduler – create one-time or recurring schedules (replaces CloudWatch Events cron).
  • EventBridge Pipes – point-to-point integration between sources and targets with filtering, enrichment, and transformation.
  • SaaS partner integrations – receive events from Zendesk, Datadog, Auth0, Shopify, etc.
  • Global endpoints – automatic failover to a secondary region for high availability.

When to Choose Which

  • Choose SQS – Decouple a producer from a single consumer, buffer traffic spikes, guarantee message processing with retries, maintain message ordering (FIFO).
  • Choose SNS – Fan-out a message to multiple subscribers simultaneously, send notifications (email/SMS), simple pub/sub without complex routing.
  • Choose EventBridge – React to AWS service events, route events based on content to different targets, integrate with SaaS applications, need schema discovery, event replay, or scheduling.
  • Combine SNS + SQS – Fan-out pattern where each subscriber needs independent processing with buffering and retry.
  • Combine EventBridge + SQS – Route events to SQS for buffered, reliable processing with backpressure handling.

AWS Certification Exam Practice Questions

  1. A company needs to process orders where each order must be processed exactly once and in the order received. Which service and configuration is most appropriate?
    1. SNS Standard topic
    2. SQS FIFO queue
    3. EventBridge with ordering
    4. SQS Standard queue
  2. An application needs to fan out a single event to three different microservices for parallel processing, each requiring independent retry logic. Which architecture is recommended?
    1. EventBridge with three targets
    2. SQS with three consumers
    3. SNS topic with three SQS queue subscriptions
    4. Three separate SQS queues with direct publishing
  3. A team needs to automatically trigger a Lambda function whenever an S3 object is created, an EC2 instance changes state, or a CodePipeline deployment fails. Which service requires the least configuration?
    1. SNS with S3 event notifications
    2. SQS with CloudWatch Events
    3. EventBridge (receives AWS events automatically)
    4. Lambda with direct triggers
  4. A SaaS application needs to react to events from Shopify and route them to different Lambda functions based on the event type (order_created vs order_cancelled). Which service is best suited?
    1. SNS with message filtering
    2. SQS with message attributes
    3. EventBridge with event pattern rules
    4. API Gateway with Lambda
  5. After a production incident, a team needs to replay all events from the past 7 days to reprocess failed orders. Which service supports this natively?
    1. SQS (messages already consumed)
    2. SNS (no retention)
    3. EventBridge (Archive and Replay)
    4. Kinesis Data Streams

Related Posts

References

Amazon SQS Developer Guide

Amazon SNS Developer Guide

Amazon EventBridge User Guide

AWS ELB – ALB vs NLB vs GWLB Comparison

📌 Updated & Expanded: This topic has been significantly expanded with advanced patterns, exam questions, and decision matrices. See the complete guide:

ALB vs NLB vs GWLB – Load Balancer Advanced Decision Guide →

AWS ELB – ALB vs NLB vs GWLB

  • AWS Elastic Load Balancing (ELB) automatically distributes incoming application traffic across multiple targets.
  • AWS offers four types of load balancers: Application Load Balancer (ALB), Network Load Balancer (NLB), Gateway Load Balancer (GWLB), and Classic Load Balancer (CLB – deprecated).
  • Choosing the right load balancer depends on the use case – Layer 7 routing, ultra-low latency, or third-party appliance integration.

ALB vs NLB vs GWLB Comparison

Feature ALB NLB GWLB
OSI Layer Layer 7 (HTTP/HTTPS) Layer 4 (TCP/UDP/TLS) Layer 3 (IP)
Use Case Web apps, microservices, content-based routing Ultra-low latency, static IP, TCP/UDP traffic Third-party virtual appliances (firewalls, IDS/IPS)
Routing Host, path, header, query string, HTTP method, source IP Port-based Transparent (GENEVE encapsulation)
Performance Handles millions of requests/sec Millions of requests/sec with ultra-low latency High throughput for appliance traffic
Static IP No (use Global Accelerator for fixed IPs) Yes (one static IP per AZ, Elastic IP supported) No
Preserve Source IP Via X-Forwarded-For header Yes (natively preserved) Yes (GENEVE encapsulation)
SSL/TLS Termination Yes Yes (TLS listener) No
WebSocket Yes Yes No
Target Types Instance, IP, Lambda Instance, IP, ALB Instance, IP
Health Checks HTTP, HTTPS TCP, HTTP, HTTPS TCP, HTTP, HTTPS
Cross-zone LB Enabled by default Disabled by default Disabled by default
Sticky Sessions Yes (cookie-based) Yes (source IP based) Yes (5-tuple/3-tuple/2-tuple)
PrivateLink Support No Yes Yes (via GWLB endpoints)
Mutual TLS (mTLS) Yes No No

Application Load Balancer – ALB

  • Operates at Layer 7 (HTTP/HTTPS) and is best suited for web applications.
  • Supports content-based routing – routes requests based on URL path, host header, HTTP headers, query strings, HTTP method, and source IP.
  • Supports multiple target groups per listener with weighted routing for blue/green and canary deployments.
  • Native integration with AWS WAF for web application security.
  • Supports authentication – integrates with Amazon Cognito and OIDC-compliant identity providers.
  • Supports Lambda functions as targets for serverless architectures.
  • Provides detailed access logs and integration with CloudWatch metrics.
  • Supports HTTP/2 and gRPC protocols.
  • Supports mutual TLS (mTLS) for client certificate authentication.
  • Supports fixed response actions and redirect actions at the listener level.

Network Load Balancer – NLB

  • Operates at Layer 4 (TCP/UDP/TLS) and handles millions of requests per second with ultra-low latency.
  • Provides a static IP address per Availability Zone and supports Elastic IP assignment.
  • Preserves source IP natively – no X-Forwarded-For header needed for TCP traffic.
  • Supports AWS PrivateLink – expose services to other VPCs or AWS accounts privately.
  • Can target ALB as a target – combines NLB’s static IP with ALB’s Layer 7 routing.
  • Supports TLS termination and centralized certificate management via ACM.
  • Handles volatile workloads and sudden traffic spikes without pre-warming.
  • Supports long-lived TCP connections – ideal for IoT, gaming, and real-time applications.
  • Supports UDP for DNS, SIP, and IoT protocols.
  • Cross-zone load balancing disabled by default – enable for even distribution across AZs.

Gateway Load Balancer – GWLB

  • Operates at Layer 3 (IP packets) using GENEVE protocol for transparent network traffic inspection.
  • Designed for deploying third-party virtual appliances – firewalls, IDS/IPS, deep packet inspection.
  • Creates a single entry/exit point for all traffic using Gateway Load Balancer Endpoints (GWLBe).
  • Traffic is transparently routed through appliances – source and destination IPs preserved.
  • Uses 5-tuple flow stickiness (source IP, dest IP, protocol, source port, dest port) by default.
  • Scales horizontally – automatically distributes traffic across multiple appliance instances.
  • Supports cross-VPC inspection via AWS PrivateLink (GWLBe in service consumer VPC).
  • Integrates with AWS Marketplace appliances from vendors like Palo Alto, Fortinet, Check Point.

When to Choose Which

  • Choose ALB – Web applications, microservices needing URL-based routing, gRPC, Lambda targets, OIDC authentication, WAF integration.
  • Choose NLB – TCP/UDP applications requiring ultra-low latency, static IPs, PrivateLink exposure, gaming/IoT, volatile traffic patterns.
  • Choose GWLB – Network traffic inspection via third-party appliances, centralized firewall deployments, compliance-driven packet inspection.
  • Combine NLB + ALB – When you need both static IPs (NLB) and content-based routing (ALB), use NLB with ALB as a target.

AWS Certification Exam Practice Questions

  1. A company needs to expose a microservices application that routes traffic based on URL paths and requires integration with AWS WAF. Which load balancer should they use?
    1. Network Load Balancer
    2. Application Load Balancer
    3. Gateway Load Balancer
    4. Classic Load Balancer
  2. An application requires a static IP address for whitelisting by partner organizations while maintaining ultra-low latency for TCP traffic. Which load balancer is most appropriate?
    1. Application Load Balancer with Global Accelerator
    2. Network Load Balancer
    3. Gateway Load Balancer
    4. Classic Load Balancer
  3. A security team needs to route all VPC traffic through a centralized fleet of third-party firewall appliances for deep packet inspection. Which AWS service should they use?
    1. Network Load Balancer
    2. AWS Network Firewall
    3. Gateway Load Balancer
    4. Application Load Balancer with AWS WAF
  4. A company needs to provide a service to multiple AWS accounts privately, with clients connecting using a static IP. Which combination is required?
    1. ALB + VPC Peering
    2. NLB + AWS PrivateLink
    3. GWLB + Transit Gateway
    4. ALB + Global Accelerator
  5. An architect needs to implement a blue/green deployment strategy with weighted routing between two versions of an application. Which load balancer feature supports this?
    1. NLB with multiple target groups
    2. ALB with weighted target groups
    3. GWLB with flow stickiness
    4. NLB with cross-zone load balancing

Related Posts

📖 Related: AWS Auto Scaling with ELB – Integration Guide

References

AWS Elastic Load Balancing User Guide

AWS ELB Features Comparison