Database on AWS — Amazon Relational Database Service (RDS)
Tags: aws, cloud, database, rds
Published: 2023-03-13 07:01:34

![Architecture](https://cdn-images-1.medium.com/max/2000/1*oJLt_NusjlUj7SUpS4Lcwg.png)

Hello everyone, I want to write about **Amazon RDS**. [Amazon RDS](https://aws.amazon.com/rds/) is an AWS service that fully-managed open-source databases like MySQL, PostgreSQL, and MariaDB and fully-managed commercial databases like Oracle and SQL Server.

Amazon RDS can connect to Amazon EC2, Amazon ECS, Amazon EKS, and many more. For networking, Amazon RDS connects to Amazon VPC. Go to Database service and click RDS. Click create a database for the next step.

![Amazon RDS](https://cdn-images-1.medium.com/max/2108/1*hn5wMILOYnKT83O9444EFQ.jpeg)

You can choose standard or easy. Standard create means you must set all configurations and easily create means you choose RDS engine type, database instance size, and database cluster only.

![EASY CREATE](https://cdn-images-1.medium.com/max/2000/1*MgVvi3PXvnZx8XhQEfQtxw.jpeg)

Choose standard create for the can setting configuration. Choose MySQL for the RDS engine type and MySQL version.

![](https://cdn-images-1.medium.com/max/2000/1*vsG7zHyAryiMUx4mhs_jzw.jpeg)

![RDS for MySQL](https://cdn-images-1.medium.com/max/2000/1*q6CSHRI4BzqXU0vo19CMLA.jpeg)

RDS has 3 templates:

 1. **free tier** — for when first time try Amazon RDS and no charge until 750 hours per month for one year.

 2. **dev/test** — for testing the application before going to the production environment.

 3. **production** — for real application and high availability.

Fill in the database instance name, username, and password for can use the RDS database.

![](https://cdn-images-1.medium.com/max/2000/1*038vt0abecu63Y-MyXeUig.jpeg)

![RDS instance template](https://cdn-images-1.medium.com/max/2000/1*gHMH4nfj5roJH1pqTsO2TA.jpeg)

When you choose free tier templates, database instance class only t classes. Choose the RDS instance. Fill in the number of storage that is needed. For availability, if want high availability choose create a standby instance.

![](https://cdn-images-1.medium.com/max/2000/1*CggmtVDCICF_n1OAVGvfOw.jpeg)

![RDS instance configuration](https://cdn-images-1.medium.com/max/2000/1*auYMRLbeueN3pQtF7s2SIg.jpeg)

If want to connect to the EC2 instance, choose to connect to an EC2 compute resource. If an EC2 instance is not available instead create an EC2 instance first. If EC2 instances is are available choose your EC2 instance.

![](https://cdn-images-1.medium.com/max/2000/1*0gtgYaP-Q_h3sRo98zhZjg.jpeg)

For VPC automatically choose because creating an EC2 instance must need VPC. For public access, choose no. For the firewall, if don’t have a security group instead create a new first, and if have a security group choose your security group. The inbound rule in the security group must open port 3306 for MySQL/Aurora.

![](https://cdn-images-1.medium.com/max/2000/1*YdGrnmb192blZddlUx6oBQ.jpeg)

![VPC NETWORKING](https://cdn-images-1.medium.com/max/2000/1*m3rPSuUCCN03C-Hr7wzEpw.jpeg)

For this tutorial, disable performance insights feature. Fill in the database name. Click **Create database**.

![](https://cdn-images-1.medium.com/max/2000/1*mdM1txfQXUQ0TklaQVjLNg.jpeg)

![](https://cdn-images-1.medium.com/max/2000/1*nCBnjJ71iddVvloltyYwlQ.jpeg)

Wait until the RDS instance database is available. While waiting to create the RDS instance database, click view credential details.

![](https://cdn-images-1.medium.com/max/2142/1*B-6ztrtALb7cawHPnTy8Lw.jpeg)

![LEFT — Before RIGHT — After](https://cdn-images-1.medium.com/max/2148/1*PDzq6nb0kC57h-NAB2SvUA.jpeg)

Copy username, password and endpoint are used to database in EC2 instance.

![](https://cdn-images-1.medium.com/max/2000/1*U8kKkBNBR7eIuPLBEnGeHw.png)

RDS subnet groups are available after created RDS database instance.

![RDS subnet groups.](https://cdn-images-1.medium.com/max/2056/1*7qe7JpuXQRZI58LSpe9wJg.jpeg)

Go to EC2, connect to EC2 instance and instead update the operation system. For Amazon Linux 2, run **sudo yum update -y**.

![](https://cdn-images-1.medium.com/max/2000/1*peZ5k5TmN50LbXWyCzyCGg.jpeg)

Run **mysql -h <RDS ENDPOINT> -u <USERNAME> -p**. When insert password, you type your password and ENTER. If successful, see Welcome to the MariaDB monitor. Type **show databases;** and see results. **budionosanrds** database is now available.

![](https://cdn-images-1.medium.com/max/2000/1*icR_bc183bRwt-E9yQk1bg.jpeg)

Then type use budionosanrds database for create table. I create table with product name and for columns have integer and varchar data type.

![](https://cdn-images-1.medium.com/max/2000/1*xjlNTA6K451i4t93VlB4gA.jpeg)

Insert several rows and try query product table for see results after query.

![](https://cdn-images-1.medium.com/max/2000/1*fRTGAh60rODqcVAYSEN4QA.jpeg)

Thank you very much.