Serverless and other compute options
Serverless services remove server management entirely: you pay per use and scaling is automatic. The exam frequently rewards serverless answers when it asks for the least operational overhead.
AWS Lambda
Run code in response to events without managing servers.
| Property | Detail |
|---|---|
| Triggers | API Gateway, ALB, S3 events, DynamoDB/Kinesis streams, SQS, SNS, EventBridge (incl. schedules), Cognito, and many more |
| Max run time | 15 minutes per invocation |
| Memory | 128 MB up to 10,240 MB; CPU scales with memory |
Ephemeral storage (/tmp) |
Configurable up to 10 GB |
| Packaging | Zip or container image (up to 10 GB) |
| Pricing | Per request + per GB-second of duration |
| Concurrency | Regional account limit (soft quota); reserved concurrency caps/guarantees a function's share; provisioned concurrency keeps environments warm to avoid cold starts |
Key points:
- Lambda in a VPC — attach to private subnets to reach RDS or internal services; needs a NAT gateway or VPC endpoints to reach the internet or AWS APIs.
- Too many DB connections from Lambda → use RDS Proxy.
- Longer than 15 minutes → Step Functions, ECS/Fargate or AWS Batch.
- Layers share libraries between functions.
"Increase Lambda performance for CPU-bound code" → increase memory (which increases CPU).
Amazon API Gateway
A managed front door for APIs.
| API type | Use |
|---|---|
| REST API | Full features: API keys, usage plans, request validation, caching, WAF, private APIs |
| HTTP API | Simpler, lower cost, lower latency; JWT authorizers; most common needs |
| WebSocket API | Two-way real-time communication (chat, live dashboards) |
Features: throttling and usage plans per client, caching (REST), authorizers (IAM, Cognito, Lambda), stages, canary deployments, edge-optimized / Regional / private endpoints. Integration timeout is 29 seconds by default — long tasks should run asynchronously.
AWS Step Functions
Orchestrates multi-step workflows as state machines — retries, error handling, branching, parallel steps, human approval, wait states.
| Standard workflows | Express workflows | |
|---|---|---|
| Duration | Up to 1 year | Up to 5 minutes |
| Execution semantics | Exactly-once | At-least-once |
| Use | Long-running business processes, order fulfilment | High-volume event processing, streaming |
Cue: "coordinate several Lambda functions with retries and error handling" → Step Functions.
AWS AppSync
Managed GraphQL (and real-time subscriptions) APIs over DynamoDB, Lambda, HTTP and other sources. Cue: "GraphQL API", "real-time updates to mobile clients", "offline sync".
Other compute services
| Service | What it is | Typical cue |
|---|---|---|
| AWS Elastic Beanstalk | Upload code; Beanstalk provisions EC2, load balancing, Auto Scaling, monitoring | "Deploy a web app quickly without managing infrastructure details, keep control of underlying resources" |
| AWS Batch | Managed batch computing — queues and schedules containerised jobs on EC2/Spot/Fargate | "Run thousands of batch jobs", "jobs longer than 15 minutes" |
| AWS Serverless Application Repository | Share and deploy pre-built serverless apps | Reuse serverless components |
| AWS Outposts | AWS infrastructure in your data centre | Low latency to on-premises systems, data residency |
| AWS Wavelength | Compute in 5G networks | Ultra-low latency mobile apps |
| AWS Local Zones | Compute close to large cities | Single-digit ms latency for a metro area |
| VMware Cloud on AWS | Run VMware workloads on AWS-managed infrastructure | Migrate vSphere workloads with minimal change |
| Amazon EMR | Managed Hadoop/Spark clusters | Big data processing (see analytics) |
Serverless vs containers vs EC2
| Choose | When |
|---|---|
| Lambda | Event-driven, short tasks, spiky or low traffic, minimal operations |
| Fargate | Containers, long-running services, no server management |
| EC2 | Full control, special hardware, steady high utilisation with reserved pricing, legacy apps |
Exam patterns
- "Process images when they're uploaded to S3" → S3 event → Lambda.
- "A serverless REST API with per-customer rate limits" → API Gateway with usage plans → Lambda → DynamoDB.
- "Multi-step order workflow with retries and compensation" → Step Functions.
- "Jobs run for hours" → AWS Batch or ECS/Fargate, not Lambda.
- "Avoid Lambda cold starts for a latency-sensitive API" → provisioned concurrency.