AWS RDS (Relational Database Service) is a managed database service provided by AWS to launch highly available, fault-tolerant, automatic failover, and scalable database servers as AWS RDS is a managed service, so it does not provide the shell access to the server. You only get the connection endpoint to connect to the database. AWS RDS provides the following benefits over a self-managed database server.

  • Independent allocation of storage, IOPS, and CPU.
  • Managed backups, failure detection, and recovery and software patching
  • Automatic and manual database backups
  • Managed access level using IAM roles
  • Managed read replicas to improve performance
  • Highly available database servers with the synchronous secondary database instance

Creating RDS cluster on AWS

The first step to create the RDS cluster on AWS is to log into the AWS management console and go to the RDS service.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-1.png" data-lazy- height="234" src="data:image/svg xml,” width=”445″>

Go to the Databases from the left side menu.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-2.png" data-lazy- height="321" src="data:image/svg xml,” width=”265″>

It will show all the database instances, if any exists. Click on the Create database button on the top right corner of the page.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-3.png" data-lazy- height="215" src="data:image/svg xml,” width=”630″>

It will display a form asking for different parameters for the database server. First, it will ask for the database creation method. AWS RDS provides two methods to create the AWS RDS instance. The standard create method is the standard method to create the database server, and it requires all the configuration of the database server by the user. While the easy create method requires fewer configurations from the user and sets the rest of the configuration to default values and these configurations can be changed later. For this demo, select the standard create method.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-4.png" data-lazy- height="190" src="data:image/svg xml,” width=”763″>

Now it will ask for the database engine type and the database software version. AWS RDS provides 6 different database engine types that are.

  • MySQL
  • Amazon Aurora
  • MariaDB
  • PostgreSQL
  • Oracle
  • Microsoft SQL Server

For this demo, select MySQL as database engine type and select the latest version of the database software.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-5.png" data-lazy- height="665" src="data:image/svg xml,” width=”762″>

Now it will ask for a template from Production, Dev/Test, and a Free tier template. Select the Production template for this demo as selecting the Free tier template will disable some features, so we will not cover them in this article.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-6.png" data-lazy- height="240" src="data:image/svg xml,” width=”763″>

After selecting the template, now enter the credentials for the database to be created. The DB instance identifier is the name of the database instance to be created, and the password will be used for authentication to connect to the database.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-7.png" data-lazy- height="550" src="data:image/svg xml,” width=”762″>

Now select the database instance class and the database instance type. There are 3 database instance types available for the Production template.

  • Standard class
  • Memory-optimized class
  • Burstable classes

Standard class includes m class of the instances, and Memory-optimized class includes r and x class of the instance while Burstable class includes m class of the instances. Select the Standard class as the database instance class and m3.medium as this demo’s instance type.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-8.png" data-lazy- height="278" src="data:image/svg xml,” width=”531″>

For the storage, there are 3 types of storage devices available for the database instances.

  • General-purpose SSD
  • Provisioned IOPS SSD
  • Magnetic

For this demo, select Provisioned IOPS as Storage type, 100 GB allocated space, 1000 IOPS, and 150 GB of maximum storage. This will initially provide a 100 GB storage block that can automatically scale up to 150 GB according to the application’s need.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-9.png" data-lazy- height="616" src="data:image/svg xml,” width=”762″>

After storage, it will now ask for the multi-AZ deployment configuration for high availability. When enabled, it will create a standby database instance in another availability zone, which will synchronously copy all the data from the primary database instance. In case of disaster, the standby instance will receive traffic until the primary database instance becomes available. For this demo, select create a standby instance.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-10.png" data-lazy- height="216" src="data:image/svg xml,” width=”585″>

Select the VPC you want to deploy the RDS cluster in, subnet group, and public access for connectivity. Public access will ensure whether the RDS instance is accessible publicly or not. If public access is not granted to the RDS cluster, the RDS cluster will not get a public IP and hence will not be accessible outside the VPC. For this demo, select the default VPC and subnet group and enable public access.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-11.png" data-lazy- height="516" src="data:image/svg xml,” width=”763″>

Security groups act as a virtual firewall and control which ports are accessible for which IPs. The database port is the port the database server will listen to. Select an existing security group for this demo or create a new one and select port as 3306.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-12.png" data-lazy- height="401" src="data:image/svg xml,” width=”764″>

The initial database name is the database name that will be created initially by the Amazon RDS. Enter an initial database name and select the default parameter group and options group.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-13.png" data-lazy- height="389" src="data:image/svg xml,” width=”763″>

Automated backups are the automatic RDS database backups for point-in-time recovery. These backups are retained for a specified number of days between 0 and 35. Amazon RDS creates these automated backups on a specific time window if the backup window is not specified. For this demo, enable the automated backups and select the retention period of 7 days and a specific time window. While taking backups, the database instance performance reduces, so select the time window when the RDS cluster load is minimal.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-14.png" data-lazy- height="524" src="data:image/svg xml,” width=”763″>

The Enable encryption option is used to determine whether the newly created backups will be encrypted or not. The AWS KMS Key is the key used to encrypt the RDS backups. For this demo, we will encrypt the Database backups using the default aws/rds key by AWS KMS.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-15.png" data-lazy- height="294" src="data:image/svg xml,” width=”763″>

Under maintenance, RDS provides minor version upgrades for the database software. These upgrades take place during a maintenance window. The Deletion protection option protects the RDS cluster from being deleted accidentally. This demo enables both the auto minor version upgrade during the default maintenance window and deletion protection.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-16.png" data-lazy- height="356" src="data:image/svg xml,” width=”763″>

Now review the whole RDS configuration and click on the Create database button at the bottom of the page to create the RDS cluster. It will take some time to create the RDS cluster. After the RDS cluster has been created, go to the databases and select the newly created database.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/How-to-create-an-RDS-cluster-on-AWS-17.png" data-lazy- height="219" src="data:image/svg xml,” width=”449″>

It will show all the details of the newly created RDS cluster. Go to the Connectivity & security tab, and there will be the RDS cluster endpoint and the port which can be used to connect to the database.

Conclusion

AWS RDS is a managed database service that supports almost all the popular SQL database engines like MySQL, PostgreSQL, MS SQL, etc. Furthermore, it also supports multi-AZ for high availability and no downtime, even in the case of an entire AWS availability zone. For performance improvements, it provides read replicas which are used to respond to read queries only. This guide describes step by step procedure to provide a highly available RDS cluster for production setup.

About the author

<img data-del="avatar" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/Zain-150×150.jpg61718c9400ec9.jpg" height="112" src="data:image/svg xml,” width=”112″>

Zain Abideen

A DevOps Engineer with expertise in provisioning and managing servers on AWS and Software delivery lifecycle (SDLC) automation. I’m from Gujranwala, Pakistan and currently working as a DevOps engineer.