Amazon Relational Database Service (RDS) is a managed database service that makes it easy to set up, operate, and scale a relational database in the cloud. RDS supports several types of databases including MySQL, PostgreSQL, Oracle, Microsoft SQL Server, and MariaDB. Each type of RDS instance is designed to meet different performance and cost requirements.
In this tutorial, we will explore various RDS instance types available on AWS, their characteristics, and use cases. Understanding these instance types will help you choose the right configuration for your database workloads.
RDS instances can be broadly categorized into two main types:
General purpose instances are further divided into two classes:
db.t3 instances provide a balance of compute and memory, making them suitable for workloads that have sporadic traffic or require moderate performance. They are cost-effective because they offer a baseline level of CPU performance with the ability to burst above this baseline when needed.
Use Cases:
db.t2 instances are similar to db.t3 but are based on older hardware. They offer a baseline level of CPU performance with the ability to burst above this baseline when needed.
Use Cases:
Memory optimized instances are designed for workloads that require large amounts of memory, such as in-memory databases, distributed caches, and high-performance web applications. They provide a high amount of RAM relative to their CPU cores.
db.r5 instances are the latest generation of memory-optimized instances. They offer up to 8 TB of RAM and are built on AWS Nitro Systems for enhanced performance and scalability.
Use Cases:
db.r4 instances are the previous generation of memory-optimized instances. They offer up to 244 GB of RAM and are suitable for workloads that require a large amount of memory.
Use Cases:
Let's look at how you can create an RDS instance using the AWS CLI. We'll start with creating a db.t3.medium instance and then move on to a db.r5.large instance.
Launch the Instance:
Use the following command to launch a db.t3.medium instance:
aws rds create-db-instance --db-instance-identifier my-t3-medium-db --db-instance-class db.t3.medium --engine mysql --allocated-storage 20 --master-username admin --master-user-password password123 --vpc-security-group-ids sg-xxxxxxxx --publicly-accessible
Info
sg-xxxxxxxx with your actual security group ID and choose a strong password for the master user.Verify the Instance:
After launching, you can verify the instance status using:
aws rds describe-db-instances --db-instance-identifier my-t3-medium-db
Launch the Instance:
Use the following command to launch a db.r5.large instance:
aws rds create-db-instance --db-instance-identifier my-r5-large-db --db-instance-class db.r5.large --engine mysql --allocated-storage 20 --master-username admin --master-user-password password123 --vpc-security-group-ids sg-xxxxxxxx --publicly-accessible
Info
sg-xxxxxxxx with your actual security group ID and choose a strong password for the master user.Verify the Instance:
After launching, you can verify the instance status using:
aws rds describe-db-instances --db-instance-identifier my-r5-large-db
Now that you have a good understanding of RDS instance types and how to create them, the next step is to learn about Amazon Virtual Private Cloud (VPC). VPC allows you to launch AWS resources into a virtual network that you define. This provides greater control over your networking environment.
You can find more information on Amazon VPC in our upcoming tutorial: Introduction to Amazon VPC.