Lab7: Introduction to Amazon Relational Database Service (RDS) Linux and Windows

Amazon Relational Database Service (Amazon RDS) is a relational database web service that makes easier to configure, operate, and scale the database system in the cloud. Amazon client is allowed to create and use MYSQL, PostgreSQL, Oracle, or Microsoft SQL server database. The tools, application, code you already use in you local machine with existing databases, now you can be used them with Amazon RDS.

Amazon RDS is cost-efficient and capacity is resizable whilst managing time-consuming database administration tasks, and it also freeing you to focus on your applications and business.

The benefits of Amazon RDS:

  • Easy to Administer
  • Highly Scalable
  • Available and Durable
  • Fast, Secure, and Inexpensive

Amazon RDS Standard Use Cases:

  • The Web and Mobile Applications
  • E-commerce Applications
  • Mobile and Online Games

This lab I will cover the following topics:

  • Creating an Amazon Relational Database Services (RDS) Instance
  • Connecting to the RDS Instance with Client Software

Steps for the task: Creating an Amazon Relational Database Services (RDS) Instance

  1. You need to log in your  AWS management Console. Click  RDS on the services menu. 1.jpg
  2. Now we are going to select database engine. In this lab, we demonstrate on “MYSQL” database system which is most popular open source relational database in the world.
  3. Click the select button across from the MYSQL database engine type on the Select Engine page.
  4. Select MySQL under Dev/Test on the Production. As we are going to do practice lab; therefore we are not going select production database.3.jpg
  5. Cleck “Next Step“. We will get “Specify DB Details” screen. We need to set some information there. In the Instance Specification area type the following data: DB Instance class: db2.t2.micro, Multi-AZ Deployment: No, Storage Type: General Purpose (SSD),  Allocation storage: 5. Note: This is only lab demo setup but in a production environment, you have to setup based on your business and application requirements.4
  6. In the setting area of the same Specify DB Details page, you need to provide your instance identification, master username and master password. Then Click “Next“.6.jpg
  7. Now You can view “Configuration Advanced Setting“. On the screen, You need to assign who will access your database instance, VPC security group and Database name, and also your backup policy.8.jpg
  8. On this Configure Advanced settings page,  you need to setup your Network and security. You can create new VPC here or you can select the previous VPC from the drop-down list.  I selected to create a new  VPC and new security group.

Database options: Give your database name. It is also called schema.

9. On the same page, you also need to configure your Backup system. The number of days for which automated backups are retained. You have put a positive number to enable this option and zero (0) for disable. I put here zero because I don’t need the backup because this configuration I made only lab purpose. 8.jpg

10. Click “Launch DB Instance“.  Your database instance will be successfully created. Then Click on “View Your DB Instance“.9.jpg

Now you can see your newly created RDS instance is ready and status is Available. 10.jpg

11. Now you need to go EC2 dashboard and select Security group. Select the “rds-launch-wizard” security group and Edit Inbound connection Rules. Traffic is allowed for anywhere. Then click  “Save“.11.jpg

Steps for the task: Create an Amazon Linux Instance from An Amazon Machine Image (AMI)

  1. Go to Amazon console and Click “EC2” from Services Menu. Then Click Launch Instance and select “Amazon Linux AMI” instance, Click “Select for the selected AMI“.12.jpg
  2. Select the default instance type t2.micro, general purpose. Click “Next: Configure Instance Details“. This is the area of networking where you would set access, monitoring, network setting, and other options.13
  3. Click Next: Add Storage. Leave this section with the default setup, But You can add more virtual hard drives, and you can also change hard drive size in this screen.14.jpg
  4. Now click Next: Add tags. And give the tag name values such as RDSlab1. Then click Next: Configure Security group. 14.jpg
  5. On the Configure Security Group page, You need to assign security group which you already created or you can assign new security group. This security group will handle your inbound and outbound traffic from your EC2 network. I selected an existing security group which is rds-launch-wizard.15.jpg
  6. Click Review and launch. Then Launch. You will see a Key-pair wizard. This key pair will allow you to access your instance after it is created. Without key pair, you will not able to access your instance. 16.jpg
  7. You can select an existing key pair or create a new key pair. I already have an existing key pair, so I chose that option; However, If you do not have any existing key pair – select create a new key pair.
  8. Click “Launch Instance” and your instance will be ready in minutes. When you will see the status is running and status check =2/2 checks. That means your instance is ready for access.

Steps for the task: Connect to Amazon EC2 instance via SSH from your Local Windows machine

You need to download PuTTY, PuTTYgen, and Pageant. If you don’t have those apps and you don’t know how to work with those application services please visit my lab practices for details (Lab4: https://momatajbegum.wordpress.com/2017/03/20/lab4-introduction-to-amazon-elastic-compute-cloud-ec2-with-linux-server/)

  1. Open your PuTTY and provide Hostname which is your public DNS of your EC2  instance or Public IP Address: 18.jpg19.jpg
  2. Go to the SSH and click Auth: Provide the Private key file authentication that you downloaded during EC2 Instance launch. Remember, You have to convert the file .pem to .ppk because by default, it is .pem extension file.20.jpg
  3. When you get the PuTTY connection via SSH, the following warning message will be displayed. Click “Yes”, You will get log in user option in the PuTTY terminal.
  4. Now log in as an “ec2-user“. 22.jpg

Steps for the task: Connecting to RDS instance

  1. Now again go to the RDS dashboard, select the newly created RDS instance, you need to copy the endpoint name without port number part to make the connection through SSH with RDS connection from your local machine. Endpoint:
    rdslab1.cjoncnib4rsw.us-west-2.rds.amazonaws.com (without port number).

Steps for the task: Connect to RDS from Amazon Window EC2 instance  

  1. Go to your instance and log in your Ec2 instance. If you don’t have SQL workbench, download it and install it on your windows machine.
  2. Open your SQL workbench and click database connection Screenshot (493).png3. Ater connection established from your EC2 instance RDS database, you will get following connection. Screenshot (492).png

Cost Analysis:

Amazon RDS for MySQL Pricing

The paying system for Amazon RDS is what you use. There is no minimum fee.

On-Demand DB Instances

On Demand Instance calculation is depend on for computing capacity by the hours you run your DB instance with no long-term commitment.  It will relieve you from the cost and complexities of the planning, purchasing, and be maintaining hardware and transforms that is actually large fixed costs into much smaller variable costs.

The Deployment price:

Single-AZ Deployment: 

The deployment price is varied in region and availability zone. Each region price depends on Amazon RDS instance size. Price is calculated based on per hour.

As I used in my practical lab, Region is US West (Oregon), I am giving the comparison the price list with my nearest availability zone of Asia Pacific (Sydney): Here I am showing the instance price for that region. But You will monitor and get your price information from the (https://aws.amazon.com/rds/mysql/pricing/).

US West (Oregon):23.jpg

Asia Pacific (Sydney):

26.jpg

Multi-AZ Deployment: 

When you run your DB Instance as a Multi-AZ deployment for enhanced data durability and availability, Amazon RDS provisions and maintains a standby in a different Availability Zone for automatic failover in the event of a scheduled or unplanned outage.

The price list for the US West (Oregon) for Multi-AZ Deployment:

US West (Oregon):24.jpg

 Asia Pacific (Sydney):

25.jpg

For both Single-AZ and Multi-AZ deployments, pricing is per DB Instance-hour consumed, from the time a DB Instance is launched until it is terminated. Each partial DB Instance-hour consumed will be billed as a full hour.

Calculating Budget plan for two regions and comparison:

Suppose you are using db.t2.micro in the US West (Oregan) for single AZ- Deployment, the standard Instance cost is $0.022 per hour. If you use it 1 month, It will be

If you use it 1 month, It will be $0.022*24*30= $158.4, and For 12 months, It will be = $15.84 * 12 =$190.08

On the other hand, If we consider the price in the Asia pacific (Sydney) for single AZ-Deployment. The standard instance cost is $0.026. The cost will be for one month = $0.026*24*30= $18.72, For 12 months, It will be = $18.72*12= $224.64. 

The cost will be for one month = $0.026*24*30= $18.72, For 12 months, It will be = $18.72*12= $224.64. 

The difference between two region cost is = $224.64-$190.08= $34.56. 

So the mathematical calculation of deployment pricing per instance for 12 months shows that region in also effect our AWS budgets plan. Therefore,  You have to analysis on the cost of different region and availability zone before selecting your RDS instance region.

Data Transfer Rate:

Inter-Region Data Transfer Out: 500 GB per month

Data Transfer Out: 100 GB per month

Data Transfer In:  100 GB per month 

Intra-Region Data Transfer: 1000 GB per month 

The Overall estimated bill will be for you per month with that data transfer: $91.90 (http://calculator.s3.amazonaws.com/index.html)

Thank you 🙂

.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s