Question #665
A company operates an on-premises social media application built with a Node.js backend and a MongoDB database storing user profiles and engagement metrics. The company plans to migrate the entire application to AWS while maintaining high availability. The application cannot be modified during migration.
Which solution meets these requirements?
Migrate the database to Amazon DynamoDB with auto-scaling enabled. Deploy the Node.js backend on Amazon EC2 instances in an Auto Scaling group across multiple Availability Zones.
Migrate the database to MongoDB on Amazon EC2 instances in a single Availability Zone. Deploy the Node.js backend on EC2 instances in an Auto Scaling group within the same Availability Zone.
Configure Amazon DocumentDB (with MongoDB compatibility) with instances distributed across multiple Availability Zones for the database. Deploy the Node.js backend on EC2 instances in an Auto Scaling group spanning multiple Availability Zones.
Use Amazon RDS for MongoDB-compatible storage with Multi-AZ deployment for the database. Deploy the Node.js backend on EC2 instances in an Auto Scaling group across multiple Availability Zones.
Explanation
Option C is correct because:
1. Amazon DocumentDB is fully compatible with MongoDB, allowing seamless migration without code changes.
2. DocumentDB instances distributed across multiple Availability Zones (AZs) ensure database high availability.
3. Deploying the Node.js backend on EC2 instances in an Auto Scaling group across multiple AZs guarantees application-layer redundancy.
Other options fail because:
- A: DynamoDB is not MongoDB-compatible, requiring application changes.
- B: MongoDB on EC2 in a single AZ lacks database high availability.
- D: Amazon RDS does not support MongoDB; DocumentDB is AWS's MongoDB-compatible service.
Key Points: Use managed services (e.g., DocumentDB) for compatibility and HA. Ensure both database and application layers span multiple AZs for fault tolerance.
Answer
The correct answer is: C