Getting Going with AWS RDS

Getting Going with AWS RDS

ยท

3 min read

RDS stands for Relational Database Service. It's a cloud-based service that helps businesses manage and use databases more easily, like organizing and accessing information in digital folders. It simplifies database tasks and removes the need to worry about the technical details of running a database system.

Amazon RDS can be used with several popular database engines, including:

  1. MySQL

  2. PostgreSQL

  3. MariaDB

  4. Oracle Database

  5. Microsoft SQL Server

  6. Amazon Aurora (which is a custom-built, compatible database engine by AWS)

In simple terms, RDS can work with different types of databases, depending on your needs, so you can choose the one that suits your application best. In this blog post, we'll be using the MySQL database.

Creating the Database

  • Open the AWS Management Console and look for RDS.

  • Access RDS, then click on the 'Create database' button.

  • Now, you have two ways to create the database.

    1. Standard create: You set all of the configuration options, including ones for availability, security, backups, and maintenance.

    2. Easy create: Use recommended best-practice configurations. Some configuration options can be changed after the database is created.

  • Choose 'Easy create' for a quick start.

  • Under Engine options, pick MySQL.

  • In Templates, opt for 'Free Tier' to prevent excessive charges.

  • Provide a name for the database to recognize it, and create a username and password for MySQL. These will be useful when connecting using the MySQL Client.

  • In the EC2 connection section, choose 'Connect to an EC2 compute resource,' and then select the EC2 Instance you want to connect to.

  • Finally, click the 'Create database' button and be patient, as it typically takes 5 to 10 minutes for RDS to create the database.

Installing MySQL Client on EC2

  • Access your EC2 Instance and begin by updating it.

      sudo apt update
    
  • Install the MySQL Client on your instance to establish a connection with the database.

      sudo apt install mysql-client-core-8.0
    
  • Now, establish a connection with the MySQL database by using the following command.

      mysql -u <username> -h <endpoint> -P 3306 -p
      Enter password: <enter-your-password>
    

    In my case, I used 'admin' as the username during the database creation. Use -h for the endpoint, which is accessible on the AWS database. -P specifies the port number for MySQL access, and -p is for the password created during database setup.

      mysql -u admin -h demo-db.ch7wjnqgouhz.us-east-1.rds.amazonaws.com -P 3306 -p
    
  • Congratulations! You have successfully connected to your MySQL database.

  • You can verify this by running a few commands.

In conclusion, AWS RDS is a powerful tool that simplifies database management, allowing you to focus on your applications rather than infrastructure. As you continue your journey with AWS RDS, remember that it's a versatile and scalable solution that can adapt to your evolving needs. Whether you're a beginner or an experienced user, AWS RDS offers a robust platform to build upon. Explore, experiment, and leverage its capabilities to optimize your data management tasks in the cloud. Happy cloud computing with AWS RDS!

ย