DEVELOPER BLOG

HOME > DEVELOPER BLOG > A Comprehensive Guide to AWS Relational Database Service (RDS)

A Comprehensive Guide to AWS Relational Database Service (RDS)

1. Introduction

The introduction provides an overview of the article's focus, which is to present a comprehensive guide on AWS Relational Database Service (RDS). It may briefly explain the significance of RDS as a managed database service that simplifies the setup, operation, and scaling of relational databases in the cloud.

2. Purpose

This section states the purpose of the article, which is to educate readers about AWS RDS and demonstrate how to set it up using the AWS Management Console and Prismscaler. It aims to provide both DevOps and non-DevOps methods to cater to different experience levels.

3. What is AWS Relational Database Service (RDS)?

Amazon Web Services (AWS) Relational Database Service (RDS) is a fully managed relational database service offered by AWS. It is designed to make it easier to set up, operate, and scale a relational database in the cloud. RDS supports various database engines, including Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database, and Microsoft SQL Server. Here are the key features and functions of AWS RDS:
  • Managed Service: AWS RDS takes care of many of the administrative tasks associated with database management, such as provisioning, patching, backups, and software updates. This allows developers and database administrators to focus on their applications rather than database maintenance.
  • Multiple Database Engines: RDS supports several popular relational database engines, allowing you to choose the one that best fits your application's requirements.
  • High Availability: RDS provides options for high availability through features like Multi-AZ (Availability Zone) deployments, which automatically replicate your database to a standby instance in a different Availability Zone for failover.
  • Scalability: You can easily scale your RDS database vertically (by adjusting the instance size) or horizontally (by adding read replicas). This ensures that your database can handle increased traffic and workload as your application grows.
  • Automated Backups: RDS automatically takes regular backups of your database, allowing you to restore to a specific point in time, recover from accidental data loss, or clone your database for testing purposes.
  • Security: RDS provides security features like network isolation (VPC), encryption at rest and in transit, and IAM-based access control. You can also use features like Database Activity Streams for auditing.
  • Performance Insights: RDS Performance Insights helps you monitor the performance of your database and identify and troubleshoot performance bottlenecks.
  • Monitoring and Logging: RDS integrates with Amazon CloudWatch for monitoring and allows you to access database logs, making it easier to troubleshoot issues and optimize database performance.
  • Database Engine Upgrades: AWS RDS makes it straightforward to upgrade your database engine to a new version, applying patches and updates without significant downtime.
  • Global Databases: For certain database engines like Amazon Aurora, you can create global databases that span multiple AWS regions for low-latency access around the world.
  • Cost-Efficiency: With RDS, you pay only for the resources you consume, making it cost-effective for both small startups and large enterprises.

4. Creating AWS Relational Database Service (RDS) with AWS Console

Step 1. DB instance prerequisites You can create an Amazon RDS DB instance only in a virtual private cloud (VPC) based on the Amazon VPC service. Also, it must be in an AWS Region that has at least two Availability Zones. The DB subnet group that you choose for the DB instance must cover at least two Availability Zones. This configuration ensures that you can configure a Multi-AZ deployment when you create the DB instance or easily move to one in the future. The following are requirements for connecting an EC2 instance with the DB instance:
  • The EC2 instance must exist in the AWS Region before you create the DB instance. If no EC2 instances exist in the AWS Region, the console provides a link to create one.
  • The user who is creating the DB instance must have permissions to perform the following operations:
    • ec2:AssociateRouteTable
    • ec2:AuthorizeSecurityGroupEgress
    • ec2:AuthorizeSecurityGroupIngress
    • ec2:CreateRouteTable
    • ec2:CreateSubnet
    • ec2:CreateSecurityGroup
    • ec2:DescribeInstances
    • ec2:DescribeNetworkInterfaces
    • ec2:DescribeRouteTables
    • ec2:DescribeSecurityGroups
    • ec2:DescribeSubnets
    • ec2:ModifyNetworkInterfaceAttribute
    • ec2:RevokeSecurityGroupEgress
Step 2. Create DB instance Go to Amazon RDS dashboard → Click to “Create database”:     Choose creation method and engine option and engine version:     Select the template according to your requirement:     Configure your database name, database user and password here:     Choose the network you want to place you RDS instance in, make sure you are using the same VPC with the EC2 instance in the previous part.     In there, you can choose VPC, subnet group and public access. When you create an RDS DB instance, you can use the AWS Management Console to set up connectivity between an EC2 instance and the new DB instance. When you do so, RDS configures your VPC and network settings automatically. The DB instance is created in the same VPC as the EC2 instance so that the EC2 instance can access the DB instance.   To connect an EC2 instance to the DB instance, choose Connect to an EC2 compute resource in the Connectivity section on the Create database page. When you choose Connect to an EC2 compute resource, RDS sets the following options automatically. You can't change these settings unless you choose not to set up connectivity with an EC2 instance by choosing Don't connect to an EC2 compute resource. After finishing your configuration, you can check the cost of your RDS instance if you launch it:      Then, click to “Create database”. Now we have a new RDS instance. Estimated Time With DevOps knowledge: 4-6hours Without DevOps knowledge: 2-3 days  

5. Creating AWS Relational Database Service (RDS) with Prismscaler

Similar to the previous section, this part introduces an alternative method using "Prismscaler" to create an AWS Relational Database Service (RDS). With PrismScaler you can save more time, instead of manipulating multiple steps on the AWS console, with just one step per form, just fill in the necessary information and press the create button.     Detailed Configuration ・ As a premise, it is necessary to build a private subnet ・ RDS_POSTGRE (db.t3.medium) ・ Connection permit from server to RDS Security Group rules   Estimated Time 5-15 minutes (without DevOps knowledge)

6. Describe more other RDS database types such as MySQL, MSSQL,...

Amazon RDS (Relational Database Service) supports several database engine types, each designed to cater to specific use cases and requirements. Here are some of the database engines supported by Amazon RDS:
  • Amazon Aurora: Amazon Aurora is a MySQL and PostgreSQL-compatible relational database built for the cloud, offering high performance and availability. It's known for its excellent performance, automatic failover, and seamless scaling capabilities. Aurora provides features like replication across multiple Availability Zones and read replicas for scaling read workloads.
  • MySQL: RDS for MySQL provides a fully managed MySQL database in the cloud. It allows you to run MySQL applications without the operational overhead of managing a database server. RDS for MySQL supports features like automated backups, Multi-AZ deployments, and integration with Amazon CloudWatch for monitoring.
  • PostgreSQL: RDS for PostgreSQL offers a managed PostgreSQL database service that is compatible with PostgreSQL-based applications. It provides features like automatic backups, automated software patching, and support for replication with read replicas.
  • MariaDB: RDS for MariaDB is a fully managed database service for MariaDB, a popular open-source relational database. It includes features like automated backups, automated software patching, and high availability options.
  • Oracle Database: RDS for Oracle provides a managed Oracle database service, enabling you to run Oracle Database workloads in the cloud. It supports features like automatic backups, automated software patching, and Oracle Transparent Data Encryption (TDE).
  • Microsoft SQL Server: RDS for SQL Server is a fully managed database service for Microsoft SQL Server. It offers support for various SQL Server editions and features, including automatic backups, Multi-AZ deployments, and high availability.
  • Amazon RDS Proxy: While not a database engine itself, RDS Proxy is a service that helps you manage database connections, improve scalability, and ensure high availability for RDS databases. It works with MySQL and PostgreSQL databases hosted on RDS.
  • Amazon RDS on VMware: This service allows you to run RDS in your on-premises VMware environment, providing the same managed database experience for your on-premises workloads.
  • Amazon RDS on Outposts: Amazon RDS on Outposts extends RDS to run on AWS Outposts, which are fully managed, on-premises compute and storage racks built with AWS hardware.

7. Reference

The reference section lists the sources or external materials used in the article, allowing readers to explore further or verify the information provided. Setting up for Amazon RDS - Amazon Relational Database Service Creating an Amazon RDS DB instance - Amazon Relational Database Service