Based on the DVA-C02 exam guideReport an error
The Lambda we covered in Week 3 is not a simple "serverless function". The Firecracker MicroVM execution model, the reliability models of the three invocation styles, the deployment lifecycle of versions, aliases, and layers, and the four layers of concurrency control — all of these are a single system, organically connected.
Today, rather than memorizing, we redraw the whole map with the question "why was it designed this way?" Then we check our real-exam instincts with 12 scenario questions in the form that actually appears on the test.
Execution environment
├── Runtimes: Python 3.12/3.11/3.10, Node.js 20/18, Java 21/17/11/8
│ Go 1.x, .NET 8/6, Ruby 3.3, Custom Runtime
├── Memory: 128MB – 10,240MB (64MB steps, 1,769MB = 1 vCPU)
├── Timeout: 1s – 900s (15 min)
├── /tmp: 512MB – 10,240MB
├── Environment variables: 4KB total
└── Deployment
├── Direct ZIP: 50MB
├── ZIP via S3: 250MB (uncompressed)
├── Container image: 10GB
└── Layers: up to 5, code+layers total 250MB
Payload
├── Synchronous (request/response): 6MB
├── Asynchronous: 256KB
└── Response Streaming: 20MB
Concurrency
├── Account/region default: 1,000 (increase can be requested)
├── Initial burst: 500–3,000 (by region)
└── Additional per minute: +500
Lambda's three invocation styles were each born from a different reliability requirement.
Synchronous invocation started from "requests that need an immediate response". When API Gateway receives an HTTP request, the client is waiting for a response. If Lambda fails, API Gateway immediately returns an error to the client. Retry is the client's decision. Simple, but no durability.
Asynchronous invocation was born from "cases where you must not lose the event". The event that a file was uploaded to S3 is held durably by the Lambda service until it is processed. If it fails after 2 retries, it goes to a DLQ for later analysis. High durability, no immediate response.
ESM polling came from "workers that consume a queue/stream". SQS or Kinesis already holds the data durably. It is natural for Lambda to actively poll and process it. Leverages the durability of the queue/stream as-is.
Invocation style → use-case mapping
API Gateway → Lambda (synchronous)
→ RESTful API, real-time lookups, synchronous processing
S3 event → Lambda (asynchronous)
→ file processing, image resizing, upload triggers
SNS → Lambda (asynchronous, fan-out)
→ distribute events to multiple processing functions
EventBridge → Lambda (asynchronous, event bus)
→ event pattern matching, scheduled execution
SQS → Lambda (ESM, load balancing)
→ order processing, email sending, async work queues
Kinesis → Lambda (ESM, ordering guarantee)
→ clickstream analysis, real-time aggregation, time-series processing
DynamoDB Streams → Lambda (ESM, change reaction)
→ search index sync, cache refresh, audit logs
The easiest way to understand Lambda's deployment model is the Git analogy.
Git Lambda
────────────────────────────────────────
commit hash version number (immutable)
HEAD $LATEST (mutable)
branch pointer alias (mutable pointer)
Git Tag version + Description
.npmignore layer (shared dependencies)
Like git checkout feature-branch, changing an alias moves traffic to a different version. Like git merge --ff-only, canary deployment enables a gradual merge 10% at a time.
| Layer | Where set | Cost | Cold start | Purpose |
|---|---|---|---|---|
| Account limit | AWS Support ticket | - | - | Overall ceiling |
| Reserved Concurrency | Function | None | No effect | Per-function isolation/ceiling |
| Provisioned Concurrency | Version/alias | Yes | Removed | Cold-start fix |
| Burst limit | Region-fixed | - | - | Scale-out rate limit |
Shared responsibility relationships:
Error in Lambda?
│
├── Synchronous invocation?
│ → immediate error response (HTTP 200 + FunctionError header)
│ → retry: caller's responsibility
│ → DLQ: none
│
├── Asynchronous invocation?
│ → Lambda service retries after 1 minute (1st)
│ → retries after 2 minutes (2nd)
│ → final failure → DLQ or Destinations OnFailure
│ → event age up to 6 hours
│
└── ESM polling?
├── SQS?
│ → message returns after visibility timeout
│ → maxReceiveCount exceeded → SQS DLQ
│ → isolate partial failures with ReportBatchItemFailures
│
└── Kinesis/DDB Streams?
→ default infinite retry (shard block risk!)
→ setting MaximumRetryAttempts is essential
→ isolate with BisectBatchOnFunctionError
→ handle final failure with OnFailure Destination
Is cold start a problem?
│
├── Java function?
│ → SnapStart (free, needs a version)
│
├── Strict response SLA (p99 < 100ms)?
│ → Provisioned Concurrency (incurs cost)
│
├── Large package size (>50MB)?
│ → separate into layers
│ → container image (leverage Lambda SnapStart)
│
├── Slow import of large libraries?
│ → lazy import (import only when needed)
│ → increase memory (CPU scales with it → faster INIT)
│
└── VPC Lambda?
→ greatly improved after Hyperplane ENI
→ if still slow, single-AZ subnet → multi-AZ
Trap 1: Provisioned Concurrency cannot be set on $LATEST.
→ You must publish a version or create an alias and set it on that.
Trap 2: SnapStart's snapshot is created when a version is published.
→ It does not work on $LATEST. After a code change, you must publish a version.
Trap 3: Kinesis ESM's default retry is infinite.
→ If you don't explicitly set MaximumRetryAttempts, the shard can be blocked permanently.
Trap 4: A VPC-attached Lambda cannot access the internet directly, even in a public subnet. → Needs a NAT Gateway + private subnet.
Trap 5: Lambda alias weights support only 2 versions. → A three-way split is not possible.
Trap 6: The SQS DLQ and the Lambda DLQ are different concepts. → SQS-Lambda ESM failure is the SQS DLQ; S3/SNS asynchronous failure is the Lambda DLQ.
Trap 7: An API key is not authentication. → It's for usage tracking and limiting.
Trap 8: A Lambda container image cannot use layers.
Trap 9: /tmp is shared with the next invocation in the same execution environment. → Be careful with sensitive data. It's not shared if the execution environment differs.
Trap 10: Asynchronous retries are 2, at 1-minute/2-minute intervals. → Not infinite.
| Domain | Lambda-related keywords |
|---|---|
| Development (32%) | runtimes, handler, event structure, context object, layers |
| Security (26%) | Execution Role, Function Policy, VPC, IMDSv2, environment variable encryption |
| Deployment (24%) | versions, aliases, CodeDeploy, SnapStart, SAM, CloudFormation |
| Troubleshooting (18%) | CloudWatch metrics, X-Ray tracing, cold-start diagnosis |
Click a choice to reveal the answer and explanation.
Question 1
A payment API Lambda function shows high latency during traffic surges. CloudWatch ConcurrentExecutions is in the normal range, and Duration P99 exceeds 3,000ms. What is the most likely cause and solution?
Question 2
When an image is uploaded to S3, Lambda generates a thumbnail and saves it to the thumbnails/ directory of the same bucket. In operation, you discover Lambda is stuck in an infinite loop. What is the cause and solution?
Question 3
In an order processing system, Lambda polls SQS to process orders. The batch size is 100, and one order failed due to an external API timeout. The remaining 99 also got reprocessed. How do you fix it?
Question 4
You're running Java Spring Boot on Lambda. Cold starts reach 3–5 seconds, violating the API response SLA. What is the cost-effective solution?
Question 5
You stored a DB password in a Lambda function's environment variables. The security team pointed out that this is encrypted only with the default KMS-managed key, so other teams in the account could potentially access it. What is the most effective solution?
Question 6
A team set Reserved Concurrency of 500 on a Lambda function. The account-wide concurrency limit is 1,000. The next day, another team's function got throttled due to a sharp traffic increase. What is the cause?
Question 7
A Lambda function polls Kinesis Data Streams, and in CloudWatch the IteratorAge metric is continuously increasing. What does it mean and how do you respond?
Question 8
Several Lambda functions use the same pandas and numpy libraries. Each function's ZIP size reaches 200MB, making deployment slow. How do you improve it?
Question 9
How does it behave when Lambda Destinations and a DLQ are configured at the same time?
Question 10
A Lambda function's code creates the DB connection inside the handler function. The operations team reports that a surge in DB connection count causes RDS Connection Limit errors. What is the most effective solution?
Question 11
What is the maximum event age of a Lambda asynchronous invocation?
Question 12
A Lambda function needs to access an internal on-premises database. This DB is only reachable over a VPN connection. How do you configure it?
| Correct count | Assessment |
|---|---|
| 11-12 | Lambda master — ready for the DVA exam |
| 9-10 | Excellent — review the scenarios you missed |
| 7-8 | Good — reread Days 11–14 and try again |
| 5-6 | Fair — start over from Firecracker MicroVM |
| 0-4 | Needs work — all of Week 3 from the beginning |