CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
  • Week 1
    • 1.AWS from a Developer's Perspective: Regions, Infrastructure, and the Boundary of Responsibility
    • 2.The 4 Core Entities of IAM: User, Group, Role, Policy
    • 3.STS and Policy Conditions: The Deep World of Temporary Credentials
    • 4.AWS CLI and SDK: From Credential Chaining to SigV4
    • 5.Week 1 Review: The Chain of Trust Built by Infrastructure and IAM
  • Week 2
  • Week 3
    • 1.Lambda Execution Model: How Firecracker MicroVMs Run Your Function
    • 2.Lambda Event Source Mapping: The Internal Polling Mechanics of SQS, Kinesis, and DynamoDB Streams
    • 3.Lambda Versions, Aliases, and Layers: The Principles of Immutable Deployment and Dependency Separation
    • 4.Lambda Concurrency Control: The Token Bucket Algorithm and Error Handling Layers
    • 5.Week 3 Review: Sharpening Your Instincts With Comprehensive Lambda Scenarios
  • Week 4
  • Week 5
  • Week 6
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
  • Week 13
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← DVA-C02/Week 3/Day 5

Based on the DVA-C02 exam guide·Report an error

DVA-C02· AssociateWeek 3 · Day 5~37 min read

Day 5 - Week 3 Review: Sharpening Your Instincts With Comprehensive Lambda Scenarios

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.

Lambda Core Specs at a Glance

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

The Three Invocation Styles: Starting Again From Design Principles

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

Versions, Aliases, and Layers: The Similarity to Git

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.

Concurrency Control: Organized by Layer

LayerWhere setCostCold startPurpose
Account limitAWS Support ticket--Overall ceiling
Reserved ConcurrencyFunctionNoneNo effectPer-function isolation/ceiling
Provisioned ConcurrencyVersion/aliasYesRemovedCold-start fix
Burst limitRegion-fixed--Scale-out rate limit

Shared responsibility relationships:

  • Reserved=300: this function runs up to 300, and 300 is deducted from the remaining functions
  • Provisioned=20 on Reserved=300: of the 300, 20 are always warm, the remaining 280 cold-start on demand

The Error-Handling Decision Tree

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

The Cold-Start Optimization Decision

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

Focused Review of Exam Traps

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.

Mapping DVA-C02 Exam Domains to Lambda

DomainLambda-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

📝 Practice Questions

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?

Self-Assessment

Correct countAssessment
11-12Lambda master — ready for the DVA exam
9-10Excellent — review the scenarios you missed
7-8Good — reread Days 11–14 and try again
5-6Fair — start over from Firecracker MicroVM
0-4Needs work — all of Week 3 from the beginning
PreviousLambda Concurrency Control: The Token Bucket Algorithm and Error Handling LayersWeek 3 · Day 4Next API Gateway REST API: The Full Path a Request Takes to Reach the BackendWeek 4 · Day 1

Official references

  • DVA-C02 official exam page(opens in a new tab)
  • AWS Lambda documentation(opens in a new tab)
  • Amazon SQS documentation(opens in a new tab)
  • Amazon VPC documentation(opens in a new tab)
  • Amazon Kinesis documentation(opens in a new tab)
  • Amazon S3 documentation(opens in a new tab)

On this page

  • Lambda Core Specs at a Glance
  • The Three Invocation Styles: Starting Again From Design Principles
  • Versions, Aliases, and Layers: The Similarity to Git
  • Concurrency Control: Organized by Layer
  • The Error-Handling Decision Tree
  • The Cold-Start Optimization Decision
  • Focused Review of Exam Traps
  • Mapping DVA-C02 Exam Domains to Lambda
  • Week 3 Comprehensive Scenario Questions
  • Self-Assessment