Welcome to Day 44 of the #90DaysOfDevOps Challenge! Today, we will explore Amazon Relational Database Service (RDS), a managed database service provided by AWS. RDS makes it easy to set up, operate, and scale a relational database in the cloud.
Amazon Relational Database Service (RDS)
Amazon Relational Database Service (RDS) is a fully managed service provided by AWS that simplifies the deployment and management of relational databases. With RDS, you have the flexibility to choose from a variety of popular database engines, including MySQL, PostgreSQL, Oracle, and SQL Server.
RDS takes care of time-consuming tasks such as database setup, patching, and backups, allowing you to focus on developing and scaling your applications. It provides automated backups, automatic software patching, and high availability options to ensure the reliability and durability of your database.
By leveraging RDS, you can offload the burden of database administration, reduce operational complexity, and take advantage of AWS's scalable infrastructure to handle your database workloads efficiently. Whether you are running a small application or a large-scale enterprise system, RDS provides the tools and features to meet your database needs securely and reliably.
With RDS, you also benefit from additional features such as:
Multi-AZ deployment for automatic failover and improved availability
Read replicas for scaling read workloads and improving performance
Security enhancements like encryption at rest and in-transit to protect your data
Performance monitoring and automated scaling to optimize database performance
Database snapshots for point-in-time recovery and replication across regions
These features empower you to build robust and scalable applications while reducing the complexity and overhead of managing your database infrastructure.
Task 1 - Creating an RDS MySQL Instance
Log in to the AWS Management Console and navigate to the RDS service.
Click on "Create database" and select "MySQL" as the database engine.
Choose the "Free Tier" template and specify the desired configuration options, such as instance size, storage, and database engine version.
Provide a unique name for your RDS instance and set a master username and password for database access.
Configure additional settings and select 'Connect to an EC2 compute resource' in the Compute Resource, as we'll access our RDS Database from EC2. You can create the EC2 instance in this step.
Configure any other additional settings and click on "Create database" to initiate the creation of the RDS instance. Wait for the instance to be created and reach the "Available" state.
Once the EC2 instance is launched, go back to the IAM service in the AWS Management Console.
Create a new IAM role and specify the RDS access permissions for the role.
Assign the IAM role to the EC2 instance you created earlier. Navigate to your EC2 instance security settings and modify the IAM role.
Now, go back to the RDS service and locate your newly created RDS MySQL instance.
Obtain the hostname, port number, and credentials (username and password) from the RDS console.
Connect to your EC2 instance and install the MySQL client on the EC2 instance
sudo apt update sudo apt install mysql-client
Use the following command to connect to the RDS instance from the EC2 instance. Make sure port 3306 is open in the inbound rule of your EC2 Instance Security Group:
mysql -h <RDS_HOST> -P <RDS_PORT> -u <USERNAME> -p
You should now be connected to the RDS MySQL instance from your EC2 instance and can start interacting with the database.
By following these steps, you will be able to create an RDS MySQL instance, launch an EC2 instance, establish a secure connection between them, and access the RDS instance using the MySQL client.
Congratulations on completing Day 44 of the #90DaysOfDevOps Challenge. Today, we dived into the world of Relational Database Service (RDS) in AWS, learning how to create, configure, and manage scalable databases in the cloud. Tomorrow, get ready for Day 45, where we'll explore the deployment of a WordPress website on AWS. Stay tuned!
Did you find this article valuable?
Support Esteban Moreno by becoming a sponsor. Any amount is appreciated!