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 reliability, deleting one EC2 instance does not provide redundancy or high availability for the application. Running in a single Availability Zone still poses a risk of downtime if that zone becomes unavailable.
This option maximizes reliability by implementing Multi-AZ for the DB instance, ensuring failover capability. Placing the EC2 instances behind an Application Load Balancer and running them in an Auto Scaling group across multiple Availability Zones provides redundancy and increases availability, as it can automatically handle instance failures and distribute traffic effectively.
Creating an additional DB instance and using AWS Lambda with API Gateway does not directly address the current reliability concerns of the existing infrastructure. This setup could complicate the architecture and does not guarantee high availability or protection against the deletion of the DB instance.
While placing EC2 instances in an Auto Scaling group across multiple Availability Zones and updating the DB instance to Multi-AZ are beneficial for reliability, using Spot Instances may lead to unpredictable availability, as they can be terminated by AWS at any time. This can introduce downtime for the application, which contradicts the goal of maximizing reliability.