exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 320 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 320
Topic #: 1
[All AWS Certified Developer Associate Questions]

A company is expanding the compatibility of its photo-sharing mobile app to hundreds of additional devices with unique screen dimensions and resolutions. Photos are stored in Amazon S3 in their original format and resolution. The company uses an Amazon CloudFront distribution to serve the photos. The app includes the dimension and resolution of the display as GET parameters with every request.

A developer needs to implement a solution that optimizes the photos that are served to each device to reduce load time and increase photo quality.

Which solution will meet these requirements MOST cost-effectively?

  • A. Use S3 Batch Operations to invoke an AWS Lambda function to create new variants of the photos with the required dimensions and resolutions. Create a dynamic CloudFront origin that automatically maps the request of each device to the corresponding photo variant.
  • B. Use S3 Batch Operations to invoke an AWS Lambda function to create new variants of the photos with the required dimensions and resolutions. Create a Lambda@Edge function to route requests to the corresponding photo variant by using request headers.
  • C. Create a Lambda@Edge function that optimizes the photos upon request and returns the photos as a response. Change the CloudFront TTL cache policy to the maximum value possible.
  • D. Create a Lambda@Edge function that optimizes the photos upon request and returns the photos as a response. In the same function, store a copy of the processed photos on Amazon S3 for subsequent requests.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
tieyua
Highly Voted 2 years, 6 months ago
Selected Answer: D
Give right answer a bump ^_^ Caching anything at max TTL is ridiculous and can't be cheap if someone really do the math, plus it only works per edge location
upvoted 15 times
...
SBoksh
Highly Voted 2 years, 8 months ago
Selected Answer: D
https://aws.amazon.com/blogs/networking-and-content-delivery/resizing-images-with-amazon-cloudfront-lambdaedge-aws-cdn-blog/
upvoted 6 times
...
LR2023
Most Recent 1 year, 8 months ago
Selected Answer: B
https://aws.amazon.com/s3/features/batch-operations/
upvoted 1 times
...
kyoharo
1 year, 9 months ago
Selected Answer: B
The most cost-effective solution to optimize the photos that are served to each device to reduce load time and increase photo quality is to use B. Use S3 Batch Operations to invoke an AWS Lambda function to create new variants of the photos with the required dimensions and resolutions. Create a Lambda@Edge function to route requests to the corresponding photo variant by using request headers. This solution is cost-effective because it only creates new photo variants when they are needed. The Lambda@Edge function routes requests to the corresponding photo variant, so that users only download the photo variant that is optimized for their device. This reduces load time and increases photo quality.
upvoted 1 times
...
dezoito
1 year, 10 months ago
Selected Answer: C
C seems to be more cost-effective.
upvoted 1 times
...
Paul_101
1 year, 11 months ago
Selected Answer: C
I select C because it ask for the most cost effective way. By selecting D you would create an additional image that would be stored on S3 but it doesnt mention how long it would be stored.
upvoted 1 times
...
rcaliandro
2 years, 1 month ago
Selected Answer: D
I will go with D, calling a lamda@edge function to modify the resuolution of the photo and "cache/save" to S3. In the C, why we need to set TTL?
upvoted 2 times
...
clarksu
2 years, 5 months ago
Selected Answer: B
Concur with mrbig00's opinion. Option A, WRONG, introduced further complexity on routing to multiple origins(buckets), Option C,D , WRONG, introducing lambda computing overhead for creation of the pics every time, Definitely WRONG.
upvoted 1 times
LittleSoap
2 years, 4 months ago
The pic is only created once as the resized photo is copied in AWS S3 for further requests so C and D should be OK, going with D
upvoted 1 times
...
...
Ankit1010
2 years, 6 months ago
B This option is cost-effective because S3 Batch Operations is a cost-effective way to process a large number of files. The use of Lambda@Edge is also cost-effective since the function executes in the AWS edge location closest to the end-user, reducing latency and data transfer costs.
upvoted 2 times
Ankit1010
2 years, 6 months ago
Option A involves creating a dynamic CloudFront origin that automatically maps the request of each device to the corresponding photo variant. This option requires more complex configuration and might not be as cost-effective as Option B. Option C involves optimizing the photos upon request using a Lambda@Edge function and changing the CloudFront TTL cache policy to the maximum value possible. While this option optimizes the photos, it might not be the most cost-effective since the TTL cache policy has to be set to the maximum value possible. Option D involves optimizing the photos upon request using a Lambda@Edge function and storing a copy of the processed photos on Amazon S3 for subsequent requests. This option might not be the most cost-effective since storing copies of the processed photos in S3 could lead to additional storage costs.
upvoted 1 times
...
...
Gordon2023
2 years, 6 months ago
Selected Answer: D
It's better to store the resized image in S3 bucket. https://aws.amazon.com/blogs/networking-and-content-delivery/resizing-images-with-amazon-cloudfront-lambdaedge-aws-cdn-blog/
upvoted 3 times
...
Bengi
2 years, 6 months ago
D seems correct to me: https://aws.amazon.com/blogs/networking-and-content-delivery/resizing-images-with-amazon-cloudfront-lambdaedge-aws-cdn-blog/
upvoted 1 times
...
unbornfroyo
2 years, 6 months ago
Selected Answer: C
Option C is the most cost-effective solution that meets the requirements. By creating a Lambda@Edge function to optimize the photos upon request and returning the photos as a response, the photo-sharing mobile app can ensure that the photos are optimized for each device's display dimension and resolution, reducing load time and increasing photo quality. Furthermore, by changing the CloudFront TTL cache policy to the maximum value possible, subsequent requests for the same photo can be served from the cache, reducing the processing overhead of the Lambda@Edge function. This solution minimizes the costs associated with creating and storing new photo variants and maximizes the use of CloudFront caching to reduce processing overhead.
upvoted 2 times
...
KT_Yu
2 years, 7 months ago
Selected Answer: C
C. Create a Lambda@Edge function that optimizes the photos upon request and returns the photos as a response. Change the CloudFront TTL cache policy to the maximum value possible.
upvoted 1 times
...
mrbig00
2 years, 8 months ago
Selected Answer: C
C. Create a Lambda@Edge function that optimizes the photos upon request and returns the photos as a response. Change the CloudFront TTL cache policy to the maximum value possible. This solution will meet the requirements most cost-effectively because it allows the developer to use a Lambda@Edge function to optimize the photos on the fly, without the need to pre-generate multiple variants of the photos for different devices. This approach can reduce the overall storage and compute costs associated with generating and storing multiple photo variants. Additionally, changing the CloudFront TTL cache policy to the maximum value possible can help reduce the number of times the Lambda@Edge function needs to be executed, further reducing the cost.
upvoted 6 times
rlnd2000
2 years, 5 months ago
Max TTL is 365 days, I don't think that is a god idea to catch every image for a year, the rest of the answer seems to be ok.
upvoted 1 times
rlnd2000
2 years, 5 months ago
I changed my mind this is the most cost effective, you don't need to store any file in S3 and the processed file will be available in cash.
upvoted 1 times
...
...
...
ubuntu1234
2 years, 8 months ago
This could be D as well, although C is also technically correct, but the workflow is complete only in D. as when objects are resized , they need to be saved again to the S3 for cache. https://aws.amazon.com/blogs/networking-and-content-delivery/resizing-images-with-amazon-cloudfront-lambdaedge-aws-cdn-blog/
upvoted 1 times
xicomynor
2 years, 8 months ago
They don't need to be saved in order to be cached. They can be cached from Cloudfront response directly, and that's why TTL for cloudfront would be set to maximum TTL
upvoted 3 times
...
...
S_S_01
2 years, 8 months ago
C For Me
upvoted 1 times
...
k1kavi1
2 years, 8 months ago
Selected Answer: C
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...