PDA

View Full Version : Question about using Amazon RDS via FQ


Mandler
02-09-2010, 09:35 PM
I want to experiment using Amazon's (MySQL) RDS service from FQ. That way, I can keep my web hosting here and push any heavy database loads to Amazon.

Using my local machine, I was able to set up a database instance on Amazon (which requires using a terminal with Java), and was then able to get Navicat to connect to the database in the same way that I am able to connect to MySQL on FQ. Now, I want to try using API calls via PHP so that my website scripts can interact with the database.

To use my local machine, I set Amazon to accept connections from my IP. In Navicat, I entered the User Name and Password as I normally would, and used the default port 3306.

Here are my questions: When I use mysql_connect() and mysql_select_db() in PHP to connect to Amazon, is it coming from the dedicated IP address assigned to my account -and- is it using port 3306? If not, what setting should I be changing on Amazon or FQ?

Thanks in advance.

Kevin
02-09-2010, 09:45 PM
Four things to mention here...

1. The originating IP address would be from the main IP of your community server not your site's IP address.

2. We firewall tcp/3306 at our routers for security reasons. This is why you have to order an external connection option from us to use it from your local system. We could do something similar for outgoing connections but you would need to talk to us at the service desk about it.

3. Standard MySQL connections are not encrypted unless you take the extra steps for SSL which is a significant performance hit. This makes them vulnerable to sniffing and man-in-the-middle attacks when running over the internet. You probably already encountered this with your use of Navicat.

4. I have never used Amazon's service specifically so I can't comment on them but in general using resources from across the internet to generate web pages is often a significant performance hit.

Mandler
02-09-2010, 09:51 PM
Hi Kevin,

Thanks so much for the quick reply and excellent info. I'll contact the Service Desk as you suggested.

The data size is fairly small, so perhaps the performance will be okay. I figure it's worth the experiment.

Thanks again... alan

Kevin
02-09-2010, 09:53 PM
The slowness is not necessarily the data size. FutureQuest and Amazon both have fat pipes. It is the latency involved in setting up a connection each time the script runs and does a connect. Especially if you factor in the overhead of negotiating an SSL session key (which is a bunch of random number generation).