Based on the SAA-C03 exam guideReport an error
The theme of Week 6 was "managed compute." AWS keeps absorbing more of the burden of running servers yourself, and we trace the spectrum from Lambda (fully serverless) through Fargate (serverless containers) to ECS/EKS (orchestration), sorting out each service's position and trade-offs. On the SAA-C03 exam this topic is tested along two axes: "which service do you choose" and "how do you connect them."
The spectrum of operational burden: EC2 (fully managed by you) → ECS/EKS + EC2 (node management) → ECS/EKS + Fargate (orchestration only) → Lambda (functions only). Moving to the right, operational burden shrinks and the AWS abstraction layer gets thicker. From a cost optimization standpoint, the right side is not always better: the steadier and higher the traffic, the cheaper EC2 or containers can be compared with Lambda. The selection criteria are "traffic pattern" and "the team's operational capability."
| Service | Core role | Exam points |
|---|---|---|
| Lambda | Event-driven function execution | Cold start vs Provisioned Concurrency, Reserved vs Provisioned, VPC attachment (Hyperplane ENI) |
| API Gateway REST | Rich API features | API Key + Usage Plan, Mapping Templates, AWS service integration, mTLS |
| API Gateway HTTP | Low-cost HTTP API | JWT Authorizer, Lambda integration, 70% cheaper than REST |
| API Gateway WebSocket | Real-time two-way | connectionId, $connect/$disconnect/$default, server push |
| Step Functions Standard | Long-running orchestration | Up to 1 year, exactly-once, waitForTaskToken, billed per state transition |
| Step Functions Express | High-throughput workflows | Up to 5 min, at-least/most-once, billed per execution count, 100K req/s |
| AppSync | Managed GraphQL | Subscription (real-time), Pipeline Resolver, N+1 DataLoader |
| ECR | Container image registry | Image scanning, Lifecycle Policy, 3 VPC Endpoints |
| ECS | AWS-native orchestrator | Task Role vs Execution Role, awsvpc mode, Blue/Green |
| EKS | Managed Kubernetes | IRSA, Managed/Self-Managed/Fargate Profiles |
| Fargate | Serverless container execution | Firecracker MicroVM isolation, Spot 70% savings |
Lambda specs quick reference:
| Item | Value |
|---|---|
| Maximum execution time | 15 minutes |
| Maximum memory | 10,240 MB (10 GB) |
| Maximum concurrent executions (Region) | Default 1,000 (can be increased) |
| Burst Concurrency | 500-3,000/min (varies by Region) |
| Deployment package (ZIP) | 50 MB (zipped), 250 MB (unzipped) |
| Deployment package (Container) | Up to 10 GB |
| Environment variables | 4 KB |
| /tmp storage | 512 MB to 10 GB |
| Provisioned Concurrency | Configurable (pre-warmed execution environments) |
Cold start mitigation strategies: Language choice (Python/Node.js are fast, Java/C# are slow), increasing memory (CPU is allocated proportionally), Provisioned Concurrency (keeps warm environments), Lambda SnapStart (snapshot restore for Java 11+, up to 10× improvement).
Reserved vs Provisioned Concurrency:
⚠️ Trap — Lambda VPC and internet access: When you attach Lambda to a VPC, it cannot access the internet by default. It can reach resources inside the VPC (RDS, ElastiCache), but external APIs and AWS Public Endpoints (the default DynamoDB and S3 endpoints) are blocked. Solutions: a private subnet + NAT Gateway (internet access), or a VPC Gateway/Interface Endpoint (AWS service access). Lambda's Hyperplane ENI has solved the ENI creation delay problem since 2019, but the NAT Gateway cost still exists.
Comparing the 3 API Gateway types:
| Feature | REST API | HTTP API | WebSocket API |
|---|---|---|---|
| Base cost | High | ~70% cheaper than REST | Based on connection time + messages |
| API Key + Usage Plan | Yes | No | No |
| Lambda Authorizer | Yes | Yes | Yes |
| JWT Authorizer (external OIDC) | No | Yes | No |
| Mapping Templates (VTL) | Yes | No | No |
| Direct AWS service integration | Yes (DDB, SNS, SQS, etc.) | No | No |
| Response Caching | Yes | No | No |
| mTLS client authentication | Yes | No | No |
| Real-time WebSocket | No | No | Yes |
| Best use | Enterprise APIs, partner integrations | Internal microservices, mobile backends | Chat, games, real-time dashboards |
Lambda Authorizer caution: The default caching TTL is 300 seconds. Setting the TTL to 0 invokes the Authorizer Lambda on every request, increasing cost and latency. Set the TTL appropriately, but when permissions must be revoked immediately (token blacklist), TTL 0 is needed. You must understand this trade-off.
Server → client push with the WebSocket API: Store the connectionId in $connect, and when the server POSTs to the Callback URL (execute-api.region.amazonaws.com/{stage}/@connections/{connectionId}), the message is pushed to the client. Server push is impossible without the connectionId.
Going deeper — REST API vs HTTP API decision tree:
Need API Keys + usage limits for external partners?
→ REST API (Usage Plan)
Integrate AWS services (DynamoDB, SQS) directly without Lambda?
→ REST API (AWS Service Integration + Mapping Templates)
JWT authentication from an external OIDC provider (Auth0, Okta)?
→ HTTP API (JWT Authorizer)
Simple Lambda/HTTP backend, cost optimization?
→ HTTP API
Real-time two-way communication?
→ WebSocket API
Standard vs Express decision criteria:
The waitForTaskToken pattern — workflows involving people:
SendTaskSuccess(taskToken) or SendTaskFailure(taskToken)If you do not set HeartbeatSeconds, the task waits up to the maximum execution time (the 1-year quota). If you set it, the task fails with States.HeartbeatTimeout when no SendTaskHeartbeat arrives within HeartbeatSeconds, and you must handle it with a Catch block.
The power of Distributed Map: Run 10,000 parallel child workflows to process large amounts of data in S3 in parallel. ToleratedFailurePercentage allows some failures, and ResultWriter stores results in S3 to get around the 256KB state data limit.
Going deeper — the Saga pattern and compensating transactions: In a microservices environment, distributed transactions spanning multiple services cannot use 2PC (2-Phase Commit), because it creates tight coupling between services and reduces availability. The Saga pattern, proposed by Garcia-Molina in 1987, processes each step as a local transaction and, on failure, cancels the already-completed steps in reverse order with compensating transactions. In Step Functions, you implement a Saga with Retry (exponential backoff retries) and Catch + States.ALL (catching all error types). Because a compensating transaction can itself fail, idempotency is important.
ECS vs EKS vs Fargate decision tree:
Need the Kubernetes standard (multi-cloud, open-source ecosystem)?
→ EKS
Need GPU / specialized instances?
→ ECS/EKS + EC2 Launch Type
Minimize node management burden, simple service deployment?
→ ECS + Fargate
Need strong kernel-level security isolation (regulated industry)?
→ Fargate (Firecracker MicroVM)
Complex deployment patterns (CRD, Operator, Helm)?
→ EKS
Run only some workloads serverless in EKS?
→ EKS + Fargate Profiles (but no DaemonSets)
Two patterns for IAM permissions:
Both patterns share the same principle: "grant IAM permissions per workload, not at the instance/node level."
⚠️ Collected traps — commonly confused concepts:
Task Role vs Task Execution Role: The Execution Role is for the ECS agent to pull from ECR + send CW logs. The Task Role is for the container code to call S3/DDB. Swapping them causes permission errors.
Fargate networking mode: Fargate supports only
awsvpcmode.bridgeandhostare not possible.3 ECR VPC Endpoints:
ecr.api+ecr.dkr+S3 Gateway Endpoint. If any one is missing, image pulls from a private subnet fail.IRSA vs Instance Profile: In EKS, if you set only the node Instance Profile, every Pod on the same node gets the same permissions — you need IRSA for per-Pod control.
Standard vs Express: Payment processing (exactly-once, over 5 minutes) = Standard. Order status lookup (high throughput, under 5 minutes) = Express.
[ User request flow ]
Mobile/Web Client
│
├─ REST/JSON ──→ API Gateway (REST) ──→ Lambda ──→ DynamoDB / S3
│ └──→ SQS → Lambda (async processing)
│
├─ GraphQL ───→ AppSync ──→ DynamoDB / Lambda / OpenSearch
│ (Real-time Push via Subscription ↓ Client)
│
└─ WebSocket → API Gateway (WS) ──→ Lambda ($connect, $default)
└──→ DynamoDB (store connectionId)
└──→ Push to other clients
[ Backend container service ]
ALB → ECS Fargate (awsvpc mode)
│ Task Role (S3, DynamoDB permissions)
└──→ RDS Proxy → Aurora Multi-AZ
[ Orchestration ]
EventBridge (schedule / events)
└──→ Step Functions (Standard)
├─ Lambda (each step)
├─ ECS Fargate Task (batch processing)
├─ waitForTaskToken (human approval)
└─ Distributed Map (large-scale parallel S3 processing)
Case study — e-commerce order processing system: A typical exam scenario. Order creation (API GW → Lambda → DDB) → payment processing (Step Functions Standard, Saga pattern, exactly-once) → inventory deduction (Lambda → DDB) → shipping request (SQS → ECS Fargate) → real-time shipment tracking updates (AppSync Subscription → Mobile App). Each step has a reason a different service is optimal: payment must be exactly-once, so Standard Step Functions; shipping handling is batch-like, so Fargate; real-time status notifications use AppSync Subscription.
Case study — media processing pipeline: Upload a video to S3 → EventBridge → Step Functions Distributed Map (10,000 chunks processed in parallel, each chunk transcoded by Lambda) → store the results with ResultWriter in S3 → distribute through CloudFront CDN. In this architecture, the Distributed Map in Standard Step Functions can do large-scale parallel processing without AWS Batch or EMR, and when processing fails, it can tolerate some failures with ToleratedFailurePercentage and then reprocess.
| Service | Built-in HA | Additional DR considerations |
|---|---|---|
| Lambda | Automatic (multi-AZ execution) | Monitor concurrency limits, configure a DLQ |
| API Gateway | Automatic (HA within the Region) | Multi-Region: Route 53 + API GW in each Region |
| Step Functions | Automatic (service-level HA) | Standard: execution history kept 1 year, Express: CloudWatch log retention |
| AppSync | Automatic (HA within the Region) | Multi-Region: integrate with Global DynamoDB Tables |
| ECS Fargate | Multi-AZ subnet configuration | ALB + spread tasks across at least 2 AZs, mix Fargate Spot + On-Demand |
| EKS | AWS-managed HA control plane | Multi-AZ node groups, automatic etcd backups |
| ECR | Automatic (S3-based durability) | Keep images in the DR Region too with cross-Region replication |
Going deeper — Lambda Destinations vs DLQ: Both are Lambda failure-handling mechanisms, but their purposes differ. A DLQ (Dead Letter Queue) sends the failed event to SQS or SNS when an asynchronous invocation fails. Lambda Destinations are more powerful: they can handle both success and failure (a DLQ handles only failure), support 4 target types (SQS, SNS, Lambda, EventBridge), and include the function response and context information in addition to the original event. In general, Lambda Destinations are recommended over a DLQ. Failure handling for Event Source Mapping (SQS, Kinesis, DDB Streams) must be configured separately, and ReportBatchItemFailures supports partial batch success.
Click a choice to reveal the answer and explanation.
Question 1
A Lambda function normally handles only a small number of requests, but every day at 9 AM hundreds of users connect at the same time and cold starts cause it to violate the response latency SLA. What is the best solution?
Question 2
You are providing an API to external SaaS partners. You must limit each partner to 10,000 requests per month, block requests when the limit is exceeded, and provide a per-partner usage dashboard. What is the best API Gateway type and feature?
Question 3
In an order processing system, three steps (payment charge, inventory deduction, shipping request) must run in order. The payment charge must run exactly once, and if any step fails, the previous steps must be canceled (refund, inventory restoration). What is the best architecture?
Question 4
You are building a real-time collaborative document editing service. When multiple users edit the same document, one user's changes must be delivered to the other users immediately. What is the best AWS architecture?
Question 5
You deploy an ECS Fargate service in a private subnet, and the containers must pull images from ECR without internet access. What components are required?
Question 6
In an EKS cluster, the payment service Pod must access only Secrets Manager, and the log collection Pod must access only CloudWatch. When the two Pods run on the same node, how do you grant IAM permissions per Pod?
Question 7
One million new files are uploaded to an S3 bucket every night. Each file must be processed independently and the results stored in DynamoDB, and if the processing failure rate exceeds 5%, the entire job must stop and send a notification. What is the best architecture?
Question 8
In an insurance claims processing system, when a customer submits a claim, a reviewer must approve or reject it within 5 business days. If the reviewer does not respond, an escalation email must be sent. What is the best way to implement this workflow?
Question 9
A startup is launching its initial service, and a backend team of 3 with no Kubernetes experience wants to deploy a container-based API server. Fast launch and minimal operational burden are the priorities. What is the best combination of services?
Question 10
A fintech company provides a multi-tenant API. Each tenant has its own DynamoDB table and S3 bucket, and the Lambda function must access only the correct resources for each tenant. In addition, Lambda cold starts must be prevented to minimize API response latency. What is the best design?
Question 11
A Lambda function is invoked asynchronously to process images. You must capture the events for images that failed processing and reprocess them, and for successfully processed images start a downstream pipeline on a separate EventBridge bus. What is the best configuration?
Question 12
A company is optimizing its AWS serverless services and is reviewing the following workloads: (1) 50,000 order status lookups per second (each lookup completes within 3 seconds), (2) 100 large report generations per month (each report takes 20 minutes). If you use Step Functions, which type should you use for each?