AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 323
A company runs an application in an Auto Scaling group of Amazon EC2 instances behind an Application Load Balancer (ALB). The EC2 instances run Docker containers that make requests to a MySQL database that runs on separate EC2 instances.
A DevOps engineer needs to update the application to use a serverless architecture.
Which solution will meet this requirement with the FEWEST changes?
Answer options
- A. Replace the containers that run on EC2 instances and the ALB with AWS Lambda functions. Replace the MySQL database with an Amazon Aurora Serverless v2 database that is compatible with MySQL.
- B. Replace the containers that run on EC2 instances with AWS Fargate. Replace the MySQL database with an Amazon Aurora Serverless v2 database that is compatible with MySQL.
- C. Replace the containers that run on EC2 instances and the ALB with AWS Lambda functions. Replace the MySQL database with Amazon DynamoDB tables.
- D. Replace the containers that run on EC2 instances with AWS Fargate. Replace the MySQL database with Amazon DynamoDB tables.
Correct answer: B
Explanation
Migrating the Docker containers from EC2 to AWS Fargate allows the application to run serverlessly with minimal changes, as Fargate natively runs existing container images. Transitioning the database from EC2-hosted MySQL to Amazon Aurora Serverless v2 preserves the relational schema and SQL compatibility, requiring far fewer code modifications than migrating to a non-relational database like Amazon DynamoDB.