First look: Amazon RDS gives you a MySQL server in the cloud

Amazon's Relational Database Service provides an easy escalator into the cloud for existing MySQL applications

RELATED TOPICS
Page 2 of 3

When you create a DB Instance, you can also define its backup window. This is a time interval within a 24-hour period during which (if specified) Amazon will automatically back up your database. Associated with the backup window parameter is the retention period parameter, which specifies how many days Amazon retains the backup. (Currently, backups can be retained for up to eight days.)

Finally, if you'd rather not depend on daily, automated backups, you can request a database snapshot at any time. And since each snapshot is associated with a unique identifier, you can create a series of snapshots and restore the database to a specific past state. Of course, storage of snapshot data is not a free service.

[ Catch InfoWorld's cloud computing reviews and analysis: Cloud versus cloud: Amazon, Google, AppNexus, and GoGrid | Inside Amazon Web Services | App builders in the sky | Windows Azure Services Platform gives wings to .Net | What cloud computing really means. ]

Working with RDS

To use Amazon RDS, you need two things: the command-line tools and a MySQL-compatible client application. The former is provided by Amazon as a set of Java applications, downloadable from the Amazon Web Services site. They handle the management of DB Instances -- creating, adjusting the parameters, deleting, and so on. The latter can be any application that communicates with a MySQL server. Of course, you also need an AWS Access ID and associated AWS Secret Access Key, both of which you receive when you sign up for Amazon Web Services.

Once you've downloaded the command-line tools, you set a pair of environment variables. One points to a file containing your AWS access key ID and secret key ID. The other holds the command-line tools' path. That done, you can create a small instance (1 ECU and 20GB of storage) using a command like:

rds-create-db-instance --db-instance-identifier rginstance --allocated-storage 20 ---db-instance-class db.m1.small --enging MySQL5.1 --master-username rgrehan --master-user-password mypassword --db-name ADBTest --headers

In this case, rds-create-db-instance is one of the command-line tools.

This produces a DB Instance identified as rginstance, whose administrator's login name is rgrehan and password is mypassword. In addition, a database named ADBTest will be created within the instance and have a maximum storage allotment of 20GB.

To connect a client application to the new database, you need its host path. You can get it with the help of the rds-describe-db-instances command, which returns information for DB Instances associated with your account, including each instance's path. If you don't want information for all your account's DB Instances, you can issue rds-describe-db-instances with a specific instance as an argument.

Finally, you have to grant access to the DB Instance to client applications. Do that with the rds-authorize-db-security-group-ingress command, passing it the CIDR-format range of IP addresses that you want to permit into your database. If you have security groups defined for Amazon EC2 instances, you can use those in place of the IP address ranges. RDS will only permit connections from clients in the security group.

RELATED TOPICS
| 1 2 3 Page 2
From CIO: 8 Free Online Courses to Grow Your Tech Skills
View Comments
Join the discussion
Be the first to comment on this article. Our Commenting Policies