AWS Academy Cloud Architecting 3 – Capstone Project || 2024 October

3 min read 14 days ago
Published on May 03, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Introduction

This tutorial guides you through the AWS Academy Cloud Architecting capstone project, focusing on using Amazon RDS with MySQL. You'll learn how to set up your database, connect it to your application, and manage data effectively, providing a solid foundation for cloud architecture.

Step 1: Setting Up Amazon RDS for MySQL

  1. Access the AWS Management Console

    • Log in to your AWS account.
    • Navigate to the RDS service.
  2. Create a New Database Instance

    • Click on "Create database."
    • Choose "MySQL" as the database engine.
    • Select the "Standard Create" option for more configuration settings.
  3. Configure Database Settings

    • Choose the version of MySQL you want to use.
    • Under "Templates," select the desired template (e.g., Production, Dev/Test).
    • Fill in the DB instance identifier, master username, and password.
    • Choose the instance class based on your performance needs.
  4. Set Storage Options

    • Specify the storage type (e.g., General Purpose SSD).
    • Set the allocated storage size depending on your project's requirements.
  5. Configure Connectivity

    • Set up the Virtual Private Cloud (VPC) settings.
    • Choose your desired subnet group and ensure that the database is publicly accessible if needed.
    • Configure security groups to allow inbound traffic on the MySQL port (default is 3306).
  6. Finalize and Create

    • Review your settings and click "Create database."
    • Wait for the status to change to "Available."

Step 2: Connecting to the Database

  1. Get Database Endpoint

    • Once the database is available, note the endpoint URL from the RDS dashboard.
  2. Set Up a Database Client

    • Use a MySQL client like MySQL Workbench or DBeaver for easy database management.
    • Download and install the client if you haven't already.
  3. Connect Using the Client

    • Open your MySQL client and select "New Connection."
    • Enter the endpoint URL, master username, and password.
    • Test the connection to ensure everything is set up correctly.

Step 3: Creating and Managing Databases

  1. Create a New Database

    • Once connected, execute the following SQL command to create a new database:
      CREATE DATABASE your_database_name;
      
  2. Create Tables and Insert Data

    • Use SQL commands to define tables and insert data. For example:
      CREATE TABLE users (
          id INT AUTO_INCREMENT PRIMARY KEY,
          name VARCHAR(100) NOT NULL,
          email VARCHAR(100) NOT NULL UNIQUE
      );
      
      INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.com');
      
  3. Querying Data

    • Retrieve data using SQL queries. For instance, to get all users:
      SELECT * FROM users;
      

Step 4: Monitoring and Optimizing Your Database

  1. Enable Enhanced Monitoring

    • In the RDS dashboard, enable enhanced monitoring to gain insights into database performance.
  2. Use Automated Backups

    • Set up automated backups for data recovery. Configure the backup window and retention period according to your needs.
  3. Optimize Queries

    • Regularly check for slow queries and optimize them by analyzing execution plans and indexing appropriately.

Conclusion

In this tutorial, you learned how to set up an Amazon RDS MySQL instance, connect to it, manage databases, and monitor performance. Familiarizing yourself with these steps will help strengthen your cloud architecture skills. As a next step, consider exploring advanced topics like replication and scaling your database for larger applications.