Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Amazon Exam SAA-C03 Topic 1 Question 64 Discussion

Actual exam question for Amazon's SAA-C03 exam
Question #: 64
Topic #: 1
[All SAA-C03 Questions]

A company is developing a latency-sensitive application. Part of the application includes several AWS Lambda functions that need to initialize as quickly as possible. The Lambda functions are written in Java and contain initialization code outside the handlers to load libraries, initialize classes, and generate unique IDs.

Which solution will meet the startup performance requirement MOST cost-effectively?

Show Suggested Answer Hide Answer
Suggested Answer: D

AWS Lambda SnapStart is designed to improve the cold start performance of Java Lambda functions by initializing the function, taking a snapshot of the execution environment, and then reusing that snapshot for subsequent invocations. However, some code (such as code that generates unique IDs or session-specific data) should run during each invocation, not during the snapshot process. By using a pre-snapshot hook and moving the unique ID generation into the handler, you ensure that non-deterministic or per-invocation code is executed correctly, while the rest of the initialization benefits from SnapStart. This delivers the lowest latency and cost, as you do not need to pay for provisioned concurrency.

AWS Documentation Extract:

'Lambda SnapStart is ideal for Java functions with long cold starts due to heavy initialization. Move non-deterministic code such as unique ID generation to the handler, and use pre-snapshot hooks to customize what gets snapshotted. SnapStart works only for published versions, not $LATEST.'

(Source: AWS Lambda documentation, Using SnapStart for Java Functions)

Other options:

A: SnapStart is not supported for the $LATEST version; must be a published version.

B & C: Provisioned concurrency removes cold starts but is more expensive than SnapStart for most workloads.

C: You must use SnapStart on published versions, but provisioned concurrency is not required for SnapStart and adds cost.


Contribute your Thoughts:

Tiera
2 hours ago
I think activating Lambda SnapStart is crucial for improving startup times, but I can't recall if it works better with provisioned concurrency or not.
upvoted 0 times
...
Carman
6 days ago
I remember we discussed how moving initialization code into the handlers could impact performance, but I'm not sure if that's the best approach here.
upvoted 0 times
...
Tricia
11 days ago
Option D is intriguing, but I'm not sure if modifying the code to add a pre-snapshot hook is the most cost-effective solution. I'll need to weigh the tradeoffs carefully.
upvoted 0 times
...
Rex
17 days ago
I'm leaning towards Option B. Provisioned concurrency might be a bit more expensive, but it should give me the control I need over startup performance.
upvoted 0 times
...
Lanie
22 days ago
Option C seems like the most straightforward approach to me. Activating SnapStart on the published versions should provide the fastest startup times.
upvoted 0 times
...
Gene
28 days ago
Hmm, I'm a bit confused by the details around SnapStart and provisioned concurrency. I'll need to review those concepts more closely before deciding.
upvoted 0 times
...
Demetra
1 month ago
This looks like a tricky question. I'll need to carefully consider the different options and their implications on cost and startup performance.
upvoted 0 times
...
Paz
1 month ago
I disagree, I believe option B is more cost-effective. Publishing versions and setting up aliases with provisioned concurrency seems like a better solution.
upvoted 0 times
...
Barney
2 months ago
I think option A is the best choice. Moving initialization code to handlers and using SnapStart should improve startup performance.
upvoted 0 times
...
Eladia
2 months ago
Option B looks like the most cost-effective solution to me. Provisioned concurrency and aliases will ensure the Lambda functions start up quickly without the overhead of SnapStart.
upvoted 0 times
...

Save Cancel