Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to 'switch' from MySQL to Amazon RDS with minimal application impact?

Amazon officially states: "Amazon RDS gives you access to the full capabilities of a familiar MySQL database. This means the code, applications, and tools you already use today with your existing MySQL databases work seamlessly with Amazon RDS."

I don't get this. Amazon RDS is accessible via web services and there a client libraries (like the one for .Net).

So if I have an existing .Net application that uses a DAL which in turn queries MySQL, how can I make the same DAL talk to the Amazon RDS (via the web services). Or am I missing something here?

like image 853
Kabeer Avatar asked Dec 11 '09 11:12

Kabeer


People also ask

What are the advantages of using Amazon RDS instead of setting up MySQL database on an EC2 instance?

RDS is easy to set up, cost-effective and allows you to focus on more important tasks. Whereas, EC2 offers complete control and flexibility for your SQL Server database. Once you understand the requirements of your application, you would be able to make a better decision.

Does changing RDS instance type cause downtime?

Downtime doesn't occur during this change. Performance might be degraded during the change. Yes to enable your DB instance to receive preferred minor DB engine version upgrades automatically when they become available. Amazon RDS performs automatic minor version upgrades in the maintenance window.

What is the best and simplest way to increase reliability of an RDS database instance?

One of the best ways to improve DB instance performance is to tune your most commonly used and most resource-intensive queries to make them less expensive to run. For information on improving queries, use the following resources: MySQL – See Optimizing SELECT statements in the MySQL documentation.


1 Answers

Amazon RDS is pure MySQL, accessible by your app the same way as any other MySQL database; the web services interface to RDS is purely for creation, deletion, and modification of the DB instances, not the DB data. From their FAQ:

Q: How do I access my running DB Instance?

Once your DB Instance is available, you can retrieve its endpoint via the DescribeDBInstance API. Using this endpoint you can construct the connection string required to connect directly with your DB Instance using your favorite database tool or programming language. In order to allow network requests to your running DB Instance, you will need to authorize access. For a detailed explanation of how to construct your connection string and get started, please refer to our Getting Started Guide.

This is the part of the Getting Started Guide you need -- it explains how to get the hostname of your new instance so you can connect to it, authorize the instance for access from the client, and then connect using the MySQL command-line client (as an example):

$ rds-describe-db-instances --headers
$ rds-authorize-db-security-group-ingress default --cidr-ip 192.0.2.0/30 --headers
$ mysql -h myinstance.crwjauxgijdf.us-east-1.rds.amazonaws.com -P 3306 -u mymasteruser -p
like image 118
delfuego Avatar answered Nov 16 '22 02:11

delfuego