Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon RDS - Online only when needed?

I had a question about Amazon RDS. I only need the database online for about 2 hours a day but I am dealing with quite a large database at around 1gb.

I have two main questions:

  1. Can I automate bringing my RDS database online and offline via scripts to save money?

  2. When I put a RDS offline to stop the "work hours" counter running and billing me, when I bring it back online will it still have the same content (i.e will all my data stay there, or will it have to be a blank DB?). If so, is there any way around this rather than backing up to S3 and reimporting it every time?

like image 630
Jimmy Avatar asked Feb 17 '13 17:02

Jimmy


People also ask

What are the limitations of Amazon RDS?

MySQL file size limits in Amazon RDS For MySQL DB instances, the maximum provisioned storage limit constrains the size of a table to a maximum size of 16 TB when using InnoDB file-per-table tablespaces. This limit also constrains the system tablespace to a maximum size of 16 TB.

Can RDS be reserved?

Amazon RDS Reserved Instances give you the option to reserve a DB instance for a one or three year term and in turn receive a significant discount compared to the On-Demand Instance pricing for the DB instance. You can choose between three payment options when you purchase a Reserved Instance.

Do RDS instances need internet?

RDS does not need to initiate connections to the internet, so it does not need access to a NAT instance / gateway. RDS is fully managed by AWS, including software updates of database that runs RDS (MySQL, PostgreSQL, etc). With database replication internet ingress is required, but that isn't provided by NAT.

Why Amazon RDS can be used for storing and maintaining data?

It lets administrators manage multiple database instances without having to learn other database management tools. These features enable RDS to help organizations cut costs that come from time-consuming database administration tasks and manage the hidden costs that come with using high-performance storage in AWS.


2 Answers

If you wish to do this programatically,

  1. Snapshot the RDS instance using rds-create-db-snapshot http://docs.aws.amazon.com/AmazonRDS/latest/CommandLineReference/CLIReference-cmd-CopyDBSnapshot.html

  2. Delete the running instance using rds-delete-db-instance http://docs.aws.amazon.com/AmazonRDS/latest/CommandLineReference/CLIReference-cmd-DeleteDBInstance.html

  3. Restore the database from the snapshot using rds-restore-db-instance-from-db-snapshot http://docs.aws.amazon.com/AmazonRDS/latest/CommandLineReference/CLIReference-cmd-RestoreDBInstanceFromDBSnapshot.html

You may also do all of this from the AWS Web Console as well, if you wish to do this manually.

like image 198
BestPractices Avatar answered Sep 28 '22 02:09

BestPractices


You can start EC2* instances using shell scripts, so I guess that you can as well for RDS. (see http://docs.aws.amazon.com/AmazonRDS....html)

But unlike EC2*, you cannot "stop" an RDS instance without "destroying" it. You need to create a DB snapshot when terminating your database. You will use this DB snapshot when re-starting the database.

*EC2 : Elastic Computing, renting a virtual server or a server.

like image 32
Thibault D. Avatar answered Sep 28 '22 01:09

Thibault D.