SAP-C02 Question 657
Single answerA company is building a real-time image processing application where users can upload images, and the application applies transformations such as resizing, filtering, and watermarking. The team has decided to use AWS Lambda due to its serverless nature. However, they are facing issues with Lambda’s 15-minute timeout when processing large image files. What is the MOST effective solution to address this issue?
- A
Break the image processing workflow into smaller tasks and use AWS Step Functions to orchestrate them.
- B
Increase the memory allocated to the Lambda function to improve performance and reduce processing time.
- C
Use Amazon EC2 for the processing instead of AWS Lambda, as EC2 does not have a timeout limit.
- D
Enable AWS Lambda's Provisioned Concurrency to avoid cold starts and reduce processing time.
Show answer and explanation
Correct answer: A
Explanation
The most effective solution is to use AWS Step Functions to break the image processing workflow into smaller, manageable tasks. Step Functions can orchestrate multiple Lambda functions in sequence or parallel, allowing each task to complete within the 15-minute limit. This maintains the serverless architecture while avoiding the timeout issue. Other options either do not address the timeout problem or introduce unnecessary complexity.
- A. Correct.
Correct. By breaking the workflow into smaller tasks and using AWS Step Functions, the application can process each step separately and avoid the 15-minute timeout. Step Functions allow for efficient orchestration of Lambda functions in a serverless manner.
- B. Incorrect.
Incorrect. Increasing memory allocation may improve performance, but it does not address the fundamental timeout limitation of AWS Lambda (15 minutes). This solution is not reliable for consistently processing large files that exceed the timeout limit.
- C. Incorrect.
Incorrect. While Amazon EC2 removes the timeout limitation, it introduces operational overhead and deviates from the serverless architecture the team has chosen. The question emphasizes solving the issue within a serverless paradigm.
- D. Incorrect.
Incorrect. Provisioned Concurrency improves performance by reducing cold starts, but it does not address the Lambda timeout limitation of 15 minutes. This is not a valid solution for the described problem.