What is Amazon RDS, and how to use it?

Key takeaways:

  • Amazon RDS simplifies the setup, operation, and scaling of relational databases in the cloud, supporting engines like MySQL, PostgreSQL, and Amazon Aurora.

  • Easy database creation and management through the RDS console, with features like snapshots, event subscriptions, and subnet groups for customization.

Amazon Relational Database Service (RDS) is a managed database service that allows you to set up, operate and scale a relational database in the cloud. It supports several popular database engines such as Amazon Aurora, MySQL, PostgreSQL, and Oracle.

Components of RDS

Below are some of the core components of RDS:

1. DB instances

A single, isolated database environment created and managed by RDS in the AWS Cloud is a database (DB) instance. It is the basic building block of Amazon RDS. Each DB instance is associated with a specific DB engine and corresponds to a single tenant.

2. DB engine

The database software that powers the DB instance is called the DB engine. Amazon RDS supports many DB engines. Each has its own characteristics, features, and requirements. Following are some DB engines supported by AWS:

  • Oracle database

  • PostgreSQL

  • Microsoft SQL

  • MySQL

  • Amazon Aurora

  • MariaDB

3. DB instance classes

DB instances are divided into classes based on size and instance class type. Each DB engine supports different instance classes. Instance type is a combination of different instance families and instance sizes.

Following are some of the instance families:

  • General purpose: It has balanced computing, memory, and networking resources. It can be used for web servers or code repositories.

  • Compute optimized: It is used for compute-bound applications where higher performance is needed. It can be used for scientific modeling or as a gaming server.

  • Memory optimized: This type is used with a large memory dataset. It is used for real-time big data analytics.

  • Accelerated optimized: Includes hardware accelerator or co-processors. It can be used for machine learning.

  • Storage optimized: When high-sequential read and write access is required to very large data sets on local storage. It can be used for NoSQL in memory or transactional databases, or data warehousing.

How to use RDS

  1. Sign in to your AWS account and open the RDS console. Here you can see many resources in the resources block.

    1. DB cluster: This refers to a distributed database system that consists of multiple database instances called Aurora replicas.

    2. Reserved instances: These are pre-purchased database instances with specific configuration and duration. these instances are solely dedicated to your usage.

    3. Snapshots: These are point-in-time backups of your database instances.

    4. Event subscriptions: These allow you to receive notifications about events related to your database instances.

    5. Parameter groups: These allow you to manage database engine configuration parameters.

    6. Option groups: These provide a way to manage database-specific features and settings.

    7. Subnet groups: They define the subnets in which your RDS instances can be deployed.

    8. Supported platform: RDS supports various database engines which offer different features, performance characteristics, and compatibility with existing applications.

    9. Default network: This refers to the virtual private cloud (VPC) network automatically created when you launch an RDS instance.

Amazon RDS dashboard
Amazon RDS dashboard
  1. Click the "Create database" button. The following window opens. Select a database creation mode. "Standard create" will allow you to set your configurations independently, while "Easy create" will use recommended configurations.

Create database window
Create database window
  1. Next, select a DB engine and instance size according to your requirements, and give your instance a name.

Create database window
Create database window
  1. According to your needs, select if you want to connect with compute resources for your database. The view default settings display the default configurations. You can make changes in the configuration after creating the database. After confirming everything, click the "Create database" button.

Create database window
Create database window
  1. Your database instance will be created.

RDS database instance window after creating database
RDS database instance window after creating database

How to connect to an Amazon RDS database

  1. Retrieve endpoint details: After your RDS instance is running, retrieve the endpoint URL from the AWS Management Console.

  2. Open connection ports: Ensure the necessary port (e.g., 3306 for MySQL) is open in your security group.

  3. Use a database client: Connect using a database client like MySQL Workbench, pgAdmin, or the native tools of the chosen database engine.

  4. Authenticate: Enter the database username, password, and endpoint to access your database. This step ensures you can easily connect to Amazon RDS and begin managing your databases.

You can also connect to the database using an EC2 instance after installing the MySQL server on the EC2 instance.

Deleting the database

Now if you want to delete a database, open the AWS console and navigate to the RDS database, and follow the steps below:

  1. Select your database. Click "Actions" and select "Delete."

Deleting a database
Deleting a database
  1. Select whether you want to keep a backup for the database or not. Then confirm it by writing delete me.

Confirming to delete database
Confirming to delete database

Key features of Amazon RDS

Some notable Amazon RDS features include:

  • Automated backups: RDS automatically backs up your database and transaction logs, allowing point-in-time recovery.

  • Multi-AZ deployment: This feature provides high availability by replicating data across multiple availability zones.

  • Read replicas: Enhance performance by enabling read-only replicas of your database to distribute read-heavy traffic.

  • Security: RDS offers encryption at rest, and in transit, and integrates with AWS Identity and Access Management (IAM) for access control.

  • Scalability: RDS allows us to scale compute and storage resources to meet demand in peak hours.

Hence RDS ensures a robust and scalable infrastructure for our relational database needs.

Amazon RDS monitoring and performance optimization

Amazon RDS integrates with AWS CloudWatch to provide detailed monitoring of your database performance. You can metrics such as CPU usage, disk I/O, and database connections. Read replicas, caching mechanisms, and fine-tuning database parameters can optimize RDS performance. RDS also supports automated performance insights that identify bottlenecks and can be fixed to make it efficient.

Amazon RDS pricing and cost optimization

RDS pricing is based on factors like instance type, storage, and data transfer. There are two pricing models:

  • On-demand pricing: Pay for the hours an instance is running.

  • Reserved instances: For long-term usage, instances can be reserved for one or three years. Reserved instances are cheaper than the on-demand instances and it is important to configure them such that they meet the workload demands.

Common use cases for Amazon RDS

Amazon RDS use cases include:

  • Web applications: RDS is ideal for managing the back-end of dynamic websites that need a dependable relational database.

  • E-commerce platforms: RDS provides secure and scalable access to databases for online transactions.

  • Data warehousing: RDS can be used as transactional data storage before ETL processes move it into a data warehouse.

  • SaaS applications: RDS can be used to host multi-tenant databases where data security and performance are critical.

These examples show how AWS RDS in production environments can be leveraged across different industries.

Frequently asked questions

Haven’t found what you were looking for? Contact Us


What is the difference between Amazon DB and Amazon RDS?

Amazon RDS is designed for use with relational databases. In contrast, DynamoDB is intended for use with non-relational databases.


What is the benefit of using Amazon RDS?

Amazon RDS enables you to encrypt your databases using keys that you control via AWS Key Management Service (KMS).


What is the difference between Amazon Aurora and Amazon RDS?

Amazon Aurora is a fully managed MySQL- and PostgreSQL-compatible relational database and RDS is a managed SQL database service. Aurora is more reliable and fault-tolerant by design as it creates multiple replicas across different regions. RDS on the other hand is not architected in such a resilient manner.


Free Resources

Copyright ©2024 Educative, Inc. All rights reserved