DEV Community

Budiono Santoso for AWS Community Builders

Posted on • Updated on

Database on AWS — Amazon Relational Database Service (RDS)

Architecture

Hello everyone, I want to write about Amazon RDS. Amazon 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

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

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

RDS for MySQL

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.

RDS instance template

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.

RDS instance configuration

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.

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.

VPC NETWORKING

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

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

LEFT — Before RIGHT — After

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

RDS subnet groups are available after created RDS database instance.

RDS subnet groups.

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

Run mysql -h -u -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.

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

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

Thank you very much.

Top comments (0)