What should the solutions architect do to maximize reliability of the application’s infrastructure?
Delete one EC2 instance and enable termination protection on the other EC2 instance. Update the DB instance to be Multi-AZ, and enable deletion protection.
Update the DB instance to be Multi-AZ, and enable deletion protection. Place the EC2 instances behind an Application Load Balancer, and run them in an EC2 Auto Scaling group across multiple Availability Zones.
Create an additional DB instance along with an Amazon API Gateway and an AWS Lambda function. Configure the application to invoke the Lambda function through API Gateway. Have the Lambda function write the data to the two DB instances.
Place the EC2 instances in an EC2 Auto Scaling group that has multiple subnets located in multiple Availability Zones. Use Spot Instances instead of On- Demand Instances. Set up Amazon CloudWatch alarms to monitor the health of the instances. Update the DB instance to be Multi-AZ, and enable deletion protection.
Explanations:
While enabling termination protection on the EC2 instance and updating the DB instance to Multi-AZ improves availability, deleting one EC2 instance reduces redundancy. It does not provide a robust solution for handling application load and fails to ensure high availability.
Updating the DB instance to Multi-AZ ensures automatic failover and improves database availability. Placing the EC2 instances behind an Application Load Balancer allows for better traffic distribution and fault tolerance. Running EC2 instances in an Auto Scaling group across multiple Availability Zones provides redundancy and scalability, significantly increasing reliability.
Creating an additional DB instance and using AWS Lambda with API Gateway introduces unnecessary complexity without addressing the primary issue of DB instance reliability. This setup does not ensure the durability and availability needed for the database as it does not focus on failover mechanisms or multi-AZ setups.
While using an Auto Scaling group and placing EC2 instances in multiple Availability Zones improves reliability, utilizing Spot Instances can lead to interruptions in service. Spot Instances are not guaranteed to be available, which could result in further availability issues for the application. Additionally, it does not explicitly mention enabling deletion protection for the DB instance.