DVA-C02 practice question 4 of 35
A company is expanding the compatibility of its photo-snaring mobile app to hundreds of additional devices with unique screen dimensions and…
Full set: 598 questionsDomain Deployment
This solution is the most cost-effective and scalable for handling a large and unpredictable number of image variants. A Lambda@Edge function, triggered by an origin request in CloudFront, can process images on-the-fly based on the GET parameters. The crucial step for cost-effectiveness is storing the newly created image variant back into an Amazon S3 bucket. This ensures that the computationally expensive optimization process runs only once for each unique image size. Subsequent requests for the same variant, even after the CloudFront cache expires or from a different edge location, can be served directly from S3 without invoking the image processing logic again, thus saving significant compute costs over time.
A. Pre-processing all possible variants with S3 Batch Operations is not cost-effective. It generates high compute and storage costs for many variants that may never be requested.
B. This option also relies on pre-processing with S3 Batch Operations, which is inefficient and costly for hundreds of potential device dimensions for every single photo stored.
C. This approach is inefficient because the Lambda@Edge function would re-process the original image on every cache miss, leading to redundant compute operations and higher costs.
1. AWS Solutions Library
"Serverless Image Handler": This official AWS solution implements the exact pattern described in the correct answer. The documentation states
"The solution generates resized
optimized images on demand... It uses Amazon CloudFront to cache the generated images and serve them from the cache on subsequent requests." This confirms the on-demand processing and caching approach.
Source: AWS Solutions Library
Serverless Image Handler
Solution overview.
2. AWS Compute Blog
"Image resizing at scale with AWS Lambda and Amazon EFS": This blog post discusses on-the-fly image processing. While it uses a different trigger
it highlights the core principle: "The main benefit of this approach is that you only generate the image sizes that you need
when you need them. This saves on storage costs and processing time." This supports the on-demand model over pre-processing.
Source: AWS Compute Blog
May 18
2022
"Image resizing at scale with AWS Lambda and Amazon EFS".
3. Amazon CloudFront Developer Guide
"Example: Resizing an image": The official documentation provides an example of using a Lambda@Edge function triggered on an origin request to resize images. The logic involves checking if a resized image already exists in S3 before attempting to create it
which is the pattern in the correct answer.
Source: Amazon CloudFront Developer Guide
Section: "Lambda@Edge example functions"
Subsection: "Example: Resizing an image".
Keep practicing
Take the free DVA-C02 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DVA-C02 practice questions
- Question 1A company has a multi-node Windows legacy application that runs on premises. The applicat…
- Question 2A developer migrated a legacy application to an AWS Lambda function. The function uses a …
- Question 3A development learn has an Amazon API Gateway REST API that is backed by an AWS Lambda fu…
- Question 5A company has an ecommerce application. To track product reviews, the company's developme…
- Question 6A social media company is designing a platform that allows users to upload data, which is…
- Question 7A developer is creating an Amazon DynamoDB table by using the AWS CLI The DynamoDB table …
