Question #871
A company hosts a web application on AWS using two Amazon EC2 instances behind an Application Load Balancer (ALB). The application relies on a MySQL database running on a separate EC2 instance, which experiences a read-heavy workload. Static content is stored on instance store volumes attached to each EC2 instance and is updated frequently, requiring manual synchronization across instances. During peak traffic hours, the database becomes a bottleneck, leading to application timeouts. Which solution will enhance the application's reliability?
Migrate the application to AWS Lambda functions configured as ALB targets. Use a single Amazon EBS volume for static content accessed by the Lambda functions. Migrate the database to an Amazon RDS for MySQL Multi-AZ DB cluster.
Containerize the application and deploy it using Amazon ECS with AWS Fargate. Use a single EBS volume mounted on the ECS cluster for static content. Enable AWS Application Auto Scaling for the ECS service. Migrate the database to Amazon RDS for MySQL Multi-AZ.
Re-architect the application using AWS Step Functions as ALB targets. Create an Amazon EFS file system for static content accessed by the Step Functions. Migrate the database to Amazon Aurora MySQL Serverless v2 with a reader instance.
Containerize the application and deploy it using Amazon ECS with AWS Fargate. Mount an Amazon EFS file system to containers for shared static content. Configure AWS Application Auto Scaling for the ECS service. Migrate the database to Amazon Aurora MySQL Serverless v2 with a reader instance.
Explanation
The correct answer is D. Here's why:
- Database Bottleneck: The MySQL database's read-heavy workload is resolved by migrating to Amazon Aurora MySQL Serverless v2, which auto-scales and includes a reader instance for read replication, reducing load.
- Static Content: Using Amazon EFS ensures shared, synchronized static content across all containers, eliminating manual synchronization issues with instance store volumes.
- Scalability & Reliability: Containerizing with ECS Fargate and enabling auto-scaling allows the application to handle traffic spikes. EFS provides durable, shared storage, while Aurora Serverless ensures high availability.
Why other options fail:
- A: Lambda cannot use a single EBS volume (stateless), and RDS Multi-AZ doesn’t scale reads.
- B: EBS cannot be shared across Fargate tasks; RDS Multi-AZ lacks read scaling.
- C: Step Functions are not ALB targets, and the solution misuses services.
Key Points: Use EFS for shared static content, Aurora Serverless for auto-scaling databases, and Fargate for scalable compute.
Answer
The correct answer is: D