DVA-C02 · Question #505
A developer is building an application that includes an AWS Lambda function that is written in .NET Core. The Lambda function's code needs to interact with Amazon DynamoDB tables and Amazon S3…
The correct answer is C. Include only the AWS SDK for .NET modules for DynamoDB and Amazon S3 in the Lambda. This question tests optimization of Lambda deployment packages by selectively including only required AWS SDK modules to minimize package size, deployment time, and cold start duration.
Question
A developer is building an application that includes an AWS Lambda function that is written in .NET Core. The Lambda function's code needs to interact with Amazon DynamoDB tables and Amazon S3 buckets. The developer must minimize the Lambda function's deployment time and invocation duration. Which solution will meet these requirements?
Options
- AIncrease the Lambda function's memory.
- BInclude the entire AWS SDK for .NET in the Lambda function's deployment package.
- CInclude only the AWS SDK for .NET modules for DynamoDB and Amazon S3 in the Lambda
- DConfigure the Lambda function to download the AWS SDK for .NET from an S3 bucket at
How the community answered
(36 responses)- A14% (5)
- B8% (3)
- C75% (27)
- D3% (1)
Why each option
This question tests optimization of Lambda deployment packages by selectively including only required AWS SDK modules to minimize package size, deployment time, and cold start duration.
Increasing Lambda memory improves CPU allocation and runtime performance but does not reduce the deployment package size or the time spent loading unnecessary SDK assemblies during initialization.
Including the entire AWS SDK for .NET bundles hundreds of unused service clients, significantly increasing package size and worsening both deployment time and cold start latency.
The AWS SDK for .NET is modular; including only the AWSSDK.DynamoDBv2 and AWSSDK.S3 NuGet packages instead of the entire SDK dramatically reduces the deployment package size. A smaller package results in faster S3 uploads during deployment, less code to load into the execution environment, and shorter cold start initialization times.
Downloading the SDK at runtime from S3 adds variable network latency on every cold start, increases invocation duration, and introduces a runtime dependency on S3 availability.
Concept tested: Lambda deployment package optimization with selective SDK module inclusion
Source: https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html
Community Discussion
No community discussion yet for this question.