SAA-C03 Question 480
Single answerA company is running a web application on Amazon EC2 instances behind an Application Load Balancer (ALB). The application stores user-uploaded files on an Amazon EFS file system. Recently, the company noticed that the application is becoming unresponsive during peak traffic times. Upon analysis, it was determined that the EC2 instances are experiencing high CPU utilization due to the processing of uploaded files. How can you optimize the architecture to improve performance while minimizing changes to the application?
- A
Move the uploaded files to Amazon S3 and process them using AWS Lambda triggered by S3 events.
- B
Use EC2 Auto Scaling to add more EC2 instances behind the ALB during peak traffic.
- C
Migrate the file processing workload to AWS Batch and keep the uploaded files on Amazon EFS.
- D
Add a caching layer using Amazon ElastiCache to reduce the load on the EC2 instances.
Show answer and explanation
Correct answer: A
Explanation
The correct answer is to move the uploaded files to Amazon S3 and use AWS Lambda to process them. This solution decouples the file processing workload from the web servers, reducing their CPU utilization and improving overall application performance. Additionally, it leverages serverless services, which are scalable and cost-effective, and requires minimal modifications to the existing architecture.
- A. Correct.
Moving the uploaded files to Amazon S3 and processing them using AWS Lambda offloads the processing workload from the EC2 instances, improving their performance. This is also a serverless solution and minimizes changes to the application.
- B. Incorrect.
Adding more EC2 instances with Auto Scaling can help handle increased traffic, but it does not optimize the file processing workload. This approach may also increase costs significantly during peak times.
- C. Incorrect.
Migrating the workload to AWS Batch would require significant changes to the application and is not the most efficient solution in this scenario.
- D. Incorrect.
Adding a caching layer like Amazon ElastiCache is useful for reducing read-heavy database or API-related loads but does not address the file processing workload issue.