Question 16
Domain 3: Resilient Cloud SolutionsA 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?
Correct answer: B
Explanation
AWS Fargate is the serverless compute option for containers, so replacing the EC2-hosted Docker containers with Fargate removes the need to manage instances. Amazon Aurora Serverless v2 is a serverless database that is “compatible with MySQL,” so it preserves the application’s database engine with minimal changes while moving to a serverless architecture.
Why each option is right or wrong
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.
Lambda requires refactoring container-based app logic and request handling more than Fargate typically does.
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.
AWS Fargate is the only serverless compute option for ECS/EKS containers, so moving the Docker workload off EC2 eliminates instance management without changing the containerized application pattern. For the database, Amazon Aurora Serverless v2 supports the MySQL-compatible edition and scales in fine-grained increments from 0.5 to 128 ACUs, which lets the app keep using MySQL semantics while shifting the backend to a serverless service with minimal code or connection changes.
C. Replace the containers that run on EC2 instances and the ALB with AWS Lambda functions. Replace the MySQL database with Amazon DynamoDB tables.
DynamoDB is NoSQL, so replacing MySQL would require major data model and application query changes.
D. Replace the containers that run on EC2 instances with AWS Fargate. Replace the MySQL database with Amazon DynamoDB tables.
Fargate minimizes compute changes, but DynamoDB still changes the relational database model too much.