SAP-C02 Question 655
Single answerA company is building a serverless application using AWS Lambda to handle image processing tasks. The application must process images uploaded to an Amazon S3 bucket, and each image processing task must complete within 15 minutes. The company also wants to ensure that the application is highly available and scalable without requiring manual intervention. Which solution will best meet these requirements?
- A
Use an AWS Lambda function triggered by an S3 event and ensure the function execution time is under 15 minutes.
- B
Use an EC2 Auto Scaling group to process images and configure health checks to ensure availability.
- C
Use AWS Lambda with Amazon SQS to handle asynchronous image processing with messages automatically triggering the Lambda function.
- D
Use AWS Lambda with AWS Step Functions to break down the image processing tasks into smaller steps if processing exceeds 15 minutes.
Show answer and explanation
Correct answer: A
Explanation
The best solution is to use AWS Lambda triggered by S3 events, as it meets the requirements for serverless architecture, scalability, high availability, and ensuring that each image processing task completes within the Lambda execution limit of 15 minutes. Other options either introduce unnecessary complexity or do not fully align with the requirements.
- A. Correct.
This is the correct option. AWS Lambda functions can be triggered by S3 events, and as long as the execution time is under 15 minutes (the maximum execution time for Lambda), this meets the requirements for availability, scalability, and no manual intervention.
- B. Incorrect.
While EC2 Auto Scaling can provide scalability, it requires more manual configuration and maintenance compared to serverless solutions like AWS Lambda. Additionally, it does not natively integrate with S3 events for triggering.
- C. Incorrect.
Using AWS Lambda with Amazon SQS is a valid pattern for asynchronous processing, but the question specifies using S3 events to trigger the processing directly, making this option less suitable.
- D. Incorrect.
AWS Step Functions can help break tasks into smaller steps, but the question specifies that each task must complete within 15 minutes. This option unnecessarily adds complexity without addressing the requirement directly.