Table of contents :
Relational Database
What is a Relational Database?
Important Aspects of Relational Databases
Amazon Relational Database Service (Amazon RDS)
What is Amazon RDS?
How does Amazon RDS work?
Benefits of using Amazon RDS
Amazon RDS Database Engines
Task: Create a Free Tier RDS Instance of MySQL
- Steps to Create a Free Tier RDS Instance of MySQL
Conclusion
✅Relational Database
✅What is a Relational Database?
Think of a relational database like a super-organized collection of data. Imagine each piece of data is stored in tables, just like rows and columns in an Excel sheet. Each row represents a specific item, and each column represents a detail about that item.
Tables: Hold all the data.
Columns: Each column stores a specific type of data, like a name or date.
Rows: These are the individual entries in the table, each representing an item, like a customer or product.
✅Important Aspects of Relational Databases
Structured Query Language (SQL): SQL is the primary interface for communicating with relational databases. It became an ANSI standard in 1986. SQL is used to add, update, delete rows of data, retrieve subsets of data, and manage all aspects of the database.
Data Integrity: Relational databases use constraints like primary keys, foreign keys, 'Not NULL', 'Unique', 'Default', and 'Check' to enforce data integrity.
Transactions: A database transaction is a sequence of operations that form a single logical unit of work. Transactions must be either fully completed (COMMIT) or fully invalidated (ROLLBACK).
ACID Compliance: Ensures data integrity through Atomicity, Consistency, Isolation, and Durability.
✅Amazon Relational Database Service (Amazon RDS)
✅What is Amazon RDS?
Amazon RDS is a cloud service that makes setting up and managing databases easy. Instead of worrying about the complex stuff like installing and maintaining a database, Amazon RDS handles it for you. You can focus on using the database for your applications.
✅How does Amazon RDS work?
Amazon RDS allows administrators to control databases through the AWS Management Console, RDS API calls, or AWS CLI. It supports various instance types with different resources (CPU, memory, storage, networking), and users can define permissions using AWS IAM.
✅Benefits of using Amazon RDS
Reduced Administration Burden: Easily deploy databases from project conception to production without installing software or infrastructure. AWS handles patches and updates.
Cost-effective: Pay only for what you use with no upfront costs.
Security: Use AWS KMS for encryption keys and authorized access.
High Availability and Durability: Automated recovery and Multi-AZ deployment for high availability.
Replication: Create read replicas for read-only copies of databases, enabling automatic failover.
Scalability: Scale infrastructure up or down in minutes.
Free Tier: AWS offers a free tier usage of RDS for 750 hours/month for 12 months.
✅Amazon RDS Database Engines
Amazon RDS supports six different database engines:
Amazon Aurora: MySQL and PostgreSQL-compatible, providing high performance and availability.
Oracle: Multiple editions with re-sizable hardware capacity, supporting both bring-your-own-license and pay-per-use models.
Microsoft SQL Server: Easy setup and scaling with support for multiple editions.
MySQL: Open-source RDBMS, accessible with familiar MySQL database engine capabilities.
PostgreSQL: Enterprise-class open-source object-relational database system.
MariaDB: MySQL-compatible database engine developed by the original MySQL developers.
✅Task: Create a Free Tier RDS Instance of MySQL
Steps to Create a Free Tier RDS Instance of MySQL
Login to AWS Console and search for "RDS".
Click on "RDS" and navigate to the RDS dashboard.
Create a database using the "Standard create" method and select "MySQL" under Engine options.
Select "Free Tier" under Templates.
Configure settings:
DB instance identifier: database-1
Master username: admin
Provide a password
Review and create the database. This process may take a few minutes.
Create an EC2 instance named e.g. ( Rds-demo-server.)
Setup EC2 Connection between RDS and EC2
Select the EC2 instance
Configure the security group to allow inbound traffic on the MySQL port (default is 3306).
- Install the MySQL client on the EC2 instance:
sudo apt-get update
sudo apt-get install mysql-client
mysql --version
Connect to the RDS instance using the MySQL client:
mysql -u admin -h <RDS_ENDPOINT> -P <RDS_PORT> -u <MASTER_USERNAME> -p
Give the Command "show databases" to see the databases and "create database aws"
✅Conclusion
Amazon RDS makes managing databases in the cloud super easy and efficient. I created a MySQL database using Amazon RDS, set up an EC2 instance, and connected to the database. This was a great hands-on experience, and I'm excited to learn more!
Happy learning! 😊