AWS Certified Developer – Associate / Question #613 of 557

Question #613

A company is using an AWS Lambda function to process events from an Amazon DynamoDB Stream. The company recently observed slow processing of the events. A developer notices that the iterator age metric for the function is increasing and that the Lambda execution duration is consistently above normal.

Which actions should the developer take to increase the processing speed? (Choose two.)

A

Increase the number of shards in the DynamoDB Stream.

B

Decrease the timeout of the Lambda function.

C

Increase the memory allocated to the Lambda function.

D

Decrease the number of shards in the DynamoDB Stream.

E

Increase the timeout of the Lambda function.

Explanation

The correct answers are A and C.

Why A and C are correct:
- A: DynamoDB Streams use shards to parallelize event processing. A high iterator age indicates Lambda cannot keep up with the stream. Increasing shards allows more concurrent Lambda invocations, improving throughput.
- C: Lambda's execution duration is tied to allocated memory (which also scales CPU). Increasing memory reduces execution time, enabling faster event processing.

Why others are incorrect:
- B/E: Adjusting timeout does not address processing speed; it only affects how long Lambda waits before terminating.
- D: Reducing shards decreases parallelism, worsening the iterator age issue.

Key Points:
- DynamoDB Streams require sufficient shards for parallel processing.
- Lambda's memory allocation directly impacts execution speed and resource availability.

Answer

The correct answer is: {A,C}