Move containers to AWS Fargate and replace MySQL with the MySQL-compatible Aurora Serverless v2

Answer Correct answer: B — move the containers to AWS Fargate and replace MySQL with the MySQL-compatible Aurora Serverless v2.

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?

  1. 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.
  2. 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. Correct Answer
  3. Replace the containers that run on EC2 instances and the ALB with AWS Lambda functions. Replace the MySQL database with Amazon DynamoDB tables.
  4. Replace the containers that run on EC2 instances with AWS Fargate. Replace the MySQL database with Amazon DynamoDB tables.

Community Votes

B
80%
A
20%

80% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

Fewest changes means preserving as much of the existing code and its interfaces as possible. Fargate keeps the Docker container model while removing the EC2 management, so the containers themselves need no change (B). Aurora Serverless v2 is MySQL-compatible, so the application's SQL and driver code work unchanged, whereas DynamoDB would require converting relational queries and the data model entirely (B over D and A). Option C is worse still because it changes both the compute model and the database, doubling the rewrite.

The application runs Docker containers on EC2 behind an ALB and talks to a self-managed MySQL database. The fewest-changes path to a serverless architecture keeps the SQL compatibility while removing the server management. Replacing the containers with AWS Fargate removes the EC2 instances and their Auto Scaling management while preserving the container model and the load balancer, and replacing MySQL with Amazon Aurora Serverless v2, which is MySQL-compatible, means the existing SQL queries and connection code continue to work. Changing to DynamoDB instead would require rewriting every query and data model.

Replacing the containers and the ALB with Lambda functions and MySQL with DynamoDB (C) — this changes the compute model and the database model simultaneously; DynamoDB is a NoSQL database so every relational query and the data model would need rewriting, and eugene2owl noted this requires multiple code changes. Replacing containers with Fargate and MySQL with DynamoDB tables (D) — as eugene2owl explained, moving from SQL to NoSQL requires rewriting the queries, so the change count is higher than keeping a MySQL-compatible database. Srikantha supported A on the grounds that Lambda is serverless, but eugene2owl's point is that A also requires the SQL-to-NoSQL conversion, which is the larger change.

Community Discussion (3 comments)

Srikantha 👍 1 Selected: A
Replace EC2 + ALB with AWS Lambda → Moves compute to serverless. Replace MySQL with Aurora Serverless v2 (MySQL-compatible) → Keeps compatibility with MySQL, meaning minimal code/database query changes. ✅ Best choice because it fully transitions to serverless (compute + database) with the least disruption to existing code. It offers a fully serverless solution with minimum code changes, since: Lambda can take over the logic in containers. Aurora Serverless v2 provides MySQL compatibility, so the data layer is minimally impacted.
CHRIS12722222 👍 2 Selected: B
fargate and aurora serverless v2
eugene2owl 👍 2 Selected: B
"B" is the most easy-to-implement option - as the question asks. The rest options require moving from SQL to NoSQL (which requires multiple code changes) and/or moving from Docker containers to Lambda (which requires multiple code changes).

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The requirement is a serverless architecture with the fewest changes, and that is best achieved by changing as little of the existing application as possible. On the compute side, replacing the Docker containers running on EC2 instances with AWS Fargate removes the instances and their Auto Scaling management while keeping the same container artifacts and the same Application Load Balancer in front, so the application code inside the containers needs no modification; Fargate is serverless in the sense that the infrastructure is managed for you (B). On the data side, replacing the self-managed MySQL database with Amazon Aurora Serverless v2 removes the database server management, and because Aurora Serverless v2 is MySQL-compatible the application's existing SQL statements, connection code, and driver configuration continue to work unchanged, while capacity scales automatically with load (B). Since neither the container code nor the query code has to be rewritten, this is the fewest-changes path. CHRIS12722222 selected this pairing directly. B is the correct answer.

Why the Other Options Are Wrong

C replaces the containers and the ALB with Lambda functions and replaces MySQL with Amazon DynamoDB tables. This changes the compute model and the database model at the same time. As eugene2owl explained, moving from SQL to a NoSQL database requires rewriting the queries and the data model, which is a substantial code change, and this option compounds that by also replacing the load balancer and container model with Lambda. A replaces the containers and ALB with Lambda functions and replaces MySQL with Aurora Serverless v2. The database half is the compatible choice, but replacing the containers with Lambda is a larger rewrite than moving the same containers to Fargate, because the application must be restructured to fit the Lambda execution model and the ALB integration changes; Srikantha favored this option on the grounds that Lambda is more purely serverless, but that reasoning does not address the rewrite cost that eugene2owl raised. D replaces the containers with Fargate, which is the right compute move, but replaces MySQL with DynamoDB tables, which as eugene2owl noted requires moving from SQL to NoSQL and therefore multiple code changes. B is correct.

Community Comment Notes

Community was split, B (80) against A (20). CHRIS12722222 selected Fargate with Aurora Serverless v2, which is the pairing in B. eugene2owl gave the decisive reasoning that B is the most easy-to-implement option as the question asks, because the other options require moving from SQL to NoSQL, which requires multiple code changes, and additionally moving from Docker containers to Lambda. Srikantha was the sole dissenter, favoring A because Lambda is more fundamentally serverless and because Aurora Serverless v2 preserves MySQL compatibility, minimizing query changes; this overlooks that B also preserves MySQL compatibility while requiring a smaller compute change. The majority view is better supported by the fewest-changes requirement.

Official Reference

Related Analysis

Practice All DOP-C02 Questions

Access 85 questions with complete answers and detailed explanations.

View Full DOP-C02 Practice Test →

← Back to DOP-C02 Study Guide