Learn how to migrate an on-premises database to Amazon RDS for MySQL and refactor the code to achieve optimum read performance for queries. Compare different solutions and choose the best one for your use case.
Table of Contents
Question
A company is migrating an on-premises database to Amazon RDS for MySQL. The company has read-heavy workloads. The company wants to refactor the code to achieve optimum read performance for queries.
Which solution will meet this requirement with LEAST current and future effort?
A. Use a multi-AZ Amazon RDS deployment. Increase the number of connections that the code makes to the database or increase the connection pool size if a connection pool is in use.
B. Use a multi-AZ Amazon RDS deployment. Modify the code so that queries access the secondary RDS instance.
C. Deploy Amazon RDS with one or more read replicas. Modify the application code so that queries use the URL for the read replicas.
D. Use open source replication software to create a copy of the MySQL database on an Amazon EC2 instance. Modify the application code so that queries use the IP address of the EC2 instance.
Answer
C. Deploy Amazon RDS with one or more read replicas. Modify the application code so that queries use the URL for the read replicas.
Explanation
The correct answer is C. Deploy Amazon RDS with one or more read replicas. Modify the application code so that queries use the URL for the read replicas.
This solution will meet the requirement with the least current and future effort because it will allow the company to offload read traffic from the primary RDS instance to the read replicas, which are asynchronously replicated copies of the primary instance. This will improve the read performance and scalability of the application, as well as provide high availability and fault tolerance in case of a failure of the primary instance. The company only needs to modify the application code to use the URL for the read replicas, which can be obtained from the Amazon RDS console or API.
The other options are not optimal because:
- Option A: Using a multi-AZ Amazon RDS deployment will provide high availability and durability, but it will not improve the read performance for queries. The secondary RDS instance in a multi-AZ deployment is not accessible for read or write operations, and it is only used as a standby replica that is synchronously replicated from the primary instance. Increasing the number of connections or the connection pool size will not help with read-heavy workloads, as it will only increase the load on the primary instance.
- Option B: Modifying the code so that queries access the secondary RDS instance in a multi-AZ deployment is not possible, as the secondary instance is not accessible for read or write operations. The secondary instance only becomes available when a failover occurs, which switches over the DNS record of the DB instance to point to the secondary DB instance.
- Option D: Using open source replication software to create a copy of the MySQL database on an Amazon EC2 instance will require more current and future effort, as it will involve installing, configuring, and maintaining the replication software and the EC2 instance. It will also introduce additional complexity and potential issues with data consistency and security. Moreover, it will not provide high availability and fault tolerance, as the EC2 instance may fail or become unavailable.
Therefore, option C is the best solution for achieving optimum read performance for queries with least current and future effort.
The latest AWS Certified Developer – Associate DVA-C02 certification actual real practice exam question and answer (Q&A) dumps are available free, which are helpful for you to pass the AWS Certified Developer – Associate DVA-C02 exam and earn AWS Certified Developer – Associate DVA-C02 certification.