Skip to main content

Getting Started with AWS RDS: A Clear and Simple Guide

In today’s cloud-centric era, efficient database management is more important than ever. 🌐 Amazon Web Services (AWS) provides a powerful managed solution called Amazon RDS (Relational Database Service) β€” designed to streamline the setup, operation, and scaling of relational databases in the cloud. ☁️

Whether you’re a beginner exploring cloud technologies or a seasoned professional aiming to scale confidently, AWS RDS offers a robust, secure, and hassle-free way to manage your database infrastructure. πŸ”§πŸ“Š


πŸ“Œ What is AWS RDS?​

Amazon RDS is a fully managed relational database service that makes it easy to set up, operate, and scale a relational database in the cloud. It takes care of routine tasks such as:

  • Hardware provisioning
  • Database setup
  • Patching
  • Backups
  • Scaling
  • Monitoring

🧠 Why Use RDS?​

Here are a few solid reasons to choose RDS:

  • βœ… Easy to use β€” With just a few clicks in the AWS Console or a simple CLI command, you can launch a database.
  • βœ… Automatic backups β€” RDS can automatically back up your database and retain snapshots.
  • βœ… High availability β€” With Multi-AZ deployments, your data is automatically replicated for failover protection.
  • βœ… Security β€” Supports encryption at rest and in transit, plus integration with AWS IAM and VPC.
  • βœ… Scalability β€” You can easily scale storage and compute resources with minimal downtime.

πŸ”§ Supported Database Engines​

Amazon RDS supports multiple popular relational database engines:

  • Amazon Aurora (MySQL & PostgreSQL compatible)
  • MySQL
  • PostgreSQL
  • MariaDB
  • Oracle
  • Microsoft SQL Server

🚦 How It Works​

At a high level, here’s how RDS functions:

  1. Launch a DB instance from the AWS Management Console or CLI.
  2. Choose the database engine, instance type, storage size, and settings.
  3. RDS provisions the database, handles patching, backups, and monitoring.
  4. You connect your application using the endpoint RDS provides.

πŸ› οΈ Key Features​

1. Automated Backups​

RDS creates daily snapshots and transaction logs, enabling point-in-time recovery.

2. Multi-AZ Deployments​

Ensures high availability by replicating data to a standby instance in another availability zone.

3. Read Replicas​

Improve read performance by offloading read queries to replicas.

4. Monitoring & Metrics​

Integrated with Amazon CloudWatch for real-time performance monitoring.

5. Security​

  • Encryption using AWS KMS
  • VPC for network isolation
  • IAM for access control

πŸ’° Pricing​

You pay for:

  • Instance hours (based on instance type)
  • Storage (allocated GB/month)
  • Backups (above the free quota)
  • Data transfer (standard AWS pricing)

πŸ‘‰ Check the AWS RDS Pricing Page for the most accurate and up-to-date details.


πŸ§ͺ Use Case Scenarios​

  • Web and mobile apps needing a backend database
  • Enterprise applications like CRM and ERP
  • Data warehousing with Amazon Aurora
  • SaaS applications requiring fast and scalable storage

βœ… Best Practices​

  • Enable automatic backups and Multi-AZ for critical applications
  • Use parameter groups for fine-tuned configurations
  • Monitor using CloudWatch and set up alarms
  • Regularly update passwords and rotate keys

πŸš€ AWS Infrastructure Setup:

RDS (MariaDB) πŸ›’οΈ + EC2 (Amazon Linux 2) πŸ–₯️ + MariaDB Installation βš™οΈ + Table Creation πŸ—‚οΈβ€‹

Let’s walk through:

  • Creating a MariaDB RDS instance
  • Launching an EC2 instance (Amazon Linux 2, kernel 5.10)
  • Installing MariaDB on EC2
  • Connecting to RDS from EC2
  • Creating a database and table via MariaDB CLI

πŸ› οΈ Step 1: Create a MariaDB RDS Instance​

  1. Go to AWS Management Console > RDS
  2. Click Create database
  3. Choose:
    • Engine: MariaDB
    • Version: Latest available (e.g., 11.4.4x)
    • Template: Free tier or Production
  4. Set DB instance identifier, master username, and password
  5. Under Connectivity:
    • Choose a VPC
    • Set β€œPublic access” to Yes (or No for private)
    • Select/create a security group that allows inbound access on port 3306
  6. Click Create database

πŸ’» Step 2: Launch an EC2 Instance (Amazon Linux 2, Kernel 5.10)​

  1. Go to EC2 > Launch instance
  2. Name your instance
  3. Choose Amazon Linux 2 AMI (HVM), Kernel 5.10
  4. Select an instance type (e.g., t2.micro)
  5. Select or create a key pair
  6. Configure network settings:
    • Same VPC as RDS
    • Allow SSH (port 22) from your IP
    • Optionally allow MySQL/Aurora (port 3306) from within the VPC
  7. Launch the instance

πŸ§‘β€πŸ’» Step 3: Connect to EC2 and Install MariaDB​

# Switch to root
sudo su

# Install MariaDB client and server
yum install mariadb-server -y

# Start and enable MariaDB
systemctl start mariadb
systemctl enable mariadb

# (Optional) Check status
systemctl status mariadb

🌐 Step 4: Connect to MariaDB RDS from EC2​

mysql -h your-rds-endpoint.rds.amazonaws.com -P 3306 -u admin -p

Enter the RDS master password when prompted.


🧱 Step 5: Create a Database and Table​

-- Create a new database
CREATE DATABASE sample_db;

-- Use the database
USE sample_db;

-- Create a table
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(100)
);

-- Insert a record
INSERT INTO users (name, email) VALUES ('Sandeep', 'sandeep@example.com');

-- Query the table
SELECT * FROM users;

🎯 Conclusion​

You’ve now successfully:

βœ… Created a MariaDB RDS instance
βœ… Launched an EC2 instance (Amazon Linux 2, Kernel 5.10)
βœ… Installed and started MariaDB on EC2
βœ… Connected to RDS using the MariaDB client
βœ… Created a database and populated a table


interviewquestions