DAY44: Relational Database Service in AWS

DAY44: Relational Database Service in AWS

Amazon RDS (Relational Database Service) is a fully managed database service provided by Amazon Web Services (AWS). It simplifies the administration and operation of relational databases, allowing you to focus on your applications rather than managing the underlying infrastructure.

With Amazon RDS, you can set up, operate, and scale a relational database in the cloud easily. It supports popular database engines such as Amazon Aurora, MySQL, PostgreSQL, MariaDB, Oracle Database, and Microsoft SQL Server.

How Amazon RDS Works?

Traditionally, database management used to be a very scattered service, from the webserver to the application server and then finally to the database. For the maintenance of such a vast system a team was required, to shrink this workforce, AWS came across an amazing all-in-one service, RDS. The whole architecture of RDS includes every aspect of the traditional management system, all in place. Thus, it includes everything from EC2 (Elastic Compute Cloud) to DNS (Domain Name System). Every part of the RDS architecture has its own separate set of features completely different from each other. A diagrammatical representation of RDS has been attached ahead.


Key features of Amazon RDS:

  1. Managed Service:

    ✔Amazon RDS is a fully managed service, meaning that AWS takes care of the underlying infrastructure, including hardware provisioning, database setup, software patching, regular backups, and automated software updates.

    ✔This allows you to offload the operational tasks associated with managing a database, reducing administrative overhead and allowing you to focus on your applications.

  2. Easy Deployment:

    ✔With Amazon RDS, you can easily deploy a relational database instance in minutes. You can choose the database engine, specify the instance size, and configure parameters such as storage, backups, and security settings using the AWS Management Console, CLI, or SDKs.

  3. Scalability:

    ✔Amazon RDS makes it easy to scale your database as your application's needs grow. You can vertically scale your database instance by changing the instance size to handle increased workload or storage requirements.

    ✔Additionally, you can horizontally scale read-heavy workloads by creating Read Replicas, which are copies of your database instance that can handle read traffic and offload the primary instance.

  4. High Availability and Durability:

    ✔Amazon RDS provides built-in high availability and data durability. It automatically performs backups and allows you to enable automated snapshots, which can be used for point-in-time recovery.

    ✔Amazon RDS also offers Multi-AZ deployments, where it synchronously replicates your database across multiple availability zones to provide automatic failover in the event of a hardware or availability zone failure.

  5. Security:

    ✔Amazon RDS offers robust security features to protect your databases. It provides network isolation through Amazon Virtual Private Cloud (VPC), encryption at rest using AWS Key Management Service (KMS), encryption in transit using SSL/TLS, and integration with AWS Identity and Access Management (IAM) for fine-grained access control.

  6. Monitoring and Metrics:

    🔑Amazon RDS provides detailed monitoring and metrics to help you understand the performance and health of your databases. You can monitor CPU usage, storage, I/O activity, and other database-specific metrics using Amazon CloudWatch.

    🔑This allows you to set alarms, troubleshoot performance issues, and optimize your database configuration.

AWS RDS Database Engines

There are six database engines which RDS provides, and they are:

  • Amazon Aurora

  • PostgreSQL

  • MySQL

  • MariaDB

  • Oracle Database

  • Microsoft SQL Server

Benefits of Amazon RDS:


  • Create a Free tier RDS instance of MySQL

    1. Go to the Amazon RDS console. Click "Create database".

      1. Select Version of PostgreSQL and select template to create a database.

        1. In settings, give the name of your database, username, and password to access the application.

          1. Set the "Virtual Private Cloud (VPC)" and "Subnet group" to create the instance.

          2. Choose the VPC security group

          3. Click "Create Database" to start the instance creation.

          4. The database is created.

        2. Create an EC2 instance

          1. Go to the Amazon EC2 console.

          2. Click "Launch Instance". Choose a Linux AMI.

          3. Choose an instance type, such as t2.micro. Choose a VPC and subnet.

          4. Configure security group rules to allow inbound traffic on the appropriate port for the type of database you are using (e.g. port 3306 for MySQL).

        3. Create an IAM role with RDS access

          1. Go to the IAM console. Click "Roles". Click "Create role".

          2. Choose the 'AWS service'.

            Choose "Allows EC2 instances to call AWS services on your behalf".

          3. Attach the "AmazonRDSFullAccess" policy.

          4. Enter a unique name for the role.

          5. Click on "Create role".

        4. Assign the role to EC2 so that your EC2 Instance can connect with RDS

          1. Go to the EC2 console and Select the instance you just created.

            Click "Actions", then "Security", then "Modify IAM Role".

          2. Choose the IAM role you just created and Click "Update IAM role".

        5. Once the RDS instance is up and running, get the credentials and connect your EC2 instance using a MySQL client.

          1. Go to the RDS console and Click "Connectivity and Security" and note the endpoint address.

          2. Click "Configuration" and note the username and password.

          3. SSH into your EC2 instance using a terminal or remote access tool.

          4. Install a MySQL client, such as "MySQL" using the command.

            sudo apt install mysql-client-core-8.0

          5. Connect to the RDS instance using the MySQL client and the endpoint address, username, and password:

              mysql -h <endpoint address> -P <> -u <username> -p
               mysql -h -P 3360 -u admin -p
          6. You should now be connected to the MySQL database on the RDS instance.

Thank you for 📖reading my blog, 👍Like it and share it 🔄 with your friends.

Happy learning😊😊