Your production team has created a Multi-AZ Amazon RDS instance.
The application connects to the instance via a custom DNS A record.
There was an instance wherein the primary database failed, and the application could no longer connect to the database.
What needs to be done to ensure that this same issue does not happen in the future?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - A.
You need to ensure that the application connects using the Amazon RDS hostname.
In the case of a primary instance issue, automatically in the backend, the swap will occur to the secondary instance.
Option B is invalid because the switch over is done by AWS.
Options C and D are invalid because you should never point to the IP address of the databases.
For more information on MultiAZ for databases, just browse to the below URL:
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZ.htmlIn a Multi-AZ Amazon RDS instance, Amazon maintains a standby replica of the primary database instance in a different availability zone (AZ) to provide high availability and automatic failover support in the event of a failure. When a failure occurs, Amazon automatically promotes the standby replica to the primary instance, and clients are automatically redirected to the new primary instance.
However, if the application is connecting to the primary database instance using a custom DNS A record, and the primary instance fails, the application will no longer be able to connect to the database. Therefore, to prevent this from happening again, the application must be modified to connect to the database instance in a more resilient way.
Option A suggests using the Amazon RDS hostname instead of a custom DNS A record. The Amazon RDS hostname is a fully qualified domain name (FQDN) that Amazon provides for each Amazon RDS instance. The hostname resolves to the primary instance's current IP address, so if the primary instance fails, the hostname will be updated to point to the new primary instance. Therefore, this option is a valid solution to the problem.
Option B suggests quickly swapping the primary database with the secondary one. While this is technically possible, it is not a recommended approach. Swapping databases can be a complex process, and it may cause data loss or other issues. Moreover, it is not a fully automated process and requires manual intervention, which may not be practical in all situations.
Option C suggests using the IP address of the primary database instance. However, if the primary instance fails, the IP address will no longer be valid, and the application will not be able to connect to the database.
Option D suggests using the IP address of the secondary database instance. This is not a recommended approach because the secondary instance is intended to be a standby replica, and connecting to it directly can cause data consistency issues and other problems.
Therefore, the correct answer is option A: ensure that the application is using the Amazon RDS hostname. By using the Amazon RDS hostname, the application will automatically be directed to the new primary instance in the event of a failure, ensuring that the application remains available and resilient.