AWS RDS:
Amazon Relational Database Service (Amazon RDS) is a collection of managed services that makes it simple to set up, operate, and scale databases in the cloud.
AWS fully managed relational database engine service where AWS is responsible for
a) Security and patching
b) Automated Backup
c) Software updates for the DB engine
d) RDS provides two options during the creation
i) Multi-AZ
ii) Standalone
e) By default AWS provides weekly maintenance for every db.
i) Multi-AZ:
If you have opted for Multi-AZ deployment with synchronous replication between the primary and standby DB instances, automatic failover is enabled as part of this configuration. A duplicate instance is consistently generated in an alternative availability zone when selecting the Multi-AZ option. It is essential to utilize Personal IOPS RDS Storage for Multi-AZ deployments.
ii) Standalone:
In Standalone AWS does not provide this type of feature
Configuration Managed by Users:
a) Managing DB Settings
b) Creating Relational Database Schema
c) Database Performance Testing
Relational Database Engine :
AWS provides 6 types of Relation Database Engine.
a) MS SQL Server
b) MySQL
c) Oracle
d) AWS Aurora
e) PostgreSQL
f) MariaDB
License for creating a database:
AWS Provides Licenses on hourly basics and you can create 10 instances at one time but BYOL (Bring Your Own License), you use your license you can create 40 instances at one time.
AWS License expires in one year.
Template Available in RDS:
a) Production: It uses defaults for High Availability and fast, consistent performance.
b) Dev/Test: This instance is intended for development use outside of a prod env.
c) Free Tier: It is used to develop new apps, test existing apps, or gain hands-on experience with Amazon RDS.
❄Tasks:
Task 1:
Create a Free tier RDS instance of PostgreSQL. Create an EC2 instance and connect your EC2 instance using the PostgreSQL client.
Step 1: Log in to AWS using the root or IAM users. (if you have permission to create EC2-instance as an IAM user)
Step 2: Search RDS on the Search bar of AWS, after successfully login. Click on RDS to create a database. Here Select "PostgreSQL".
Step 3: Select Version of PostgreSQL and select template to create a database.
Step 4: In settings, give the name of your database, username, and password to access the application.
Step 5: Launch an EC2 instance to configure the database.
Step 6: Select that EC2 instance to configure the database.
Step 7: Check the below configuration and click on the "Create Database" button.
Step 8: Verify database is created successfully.
Step 9: Access EC2-Instance over the CLI and connect with PostgreSQL Client.
# connect to mysql client
sudo psql -h database-1.cjmn0fa8hcg3.ap-south-1.rds.amazonaws.com -P 3306 -u admin -p
Congratulations!! Successfully Able to access PostgreSQL Client.
Task 2:
Create a Free tier RDS instance of MySQL. Create an EC2 instance. Create an IAM role with RDS access. Assign the role to EC2 so that your EC2 Instance can connect with RDS. Once the RDS instance is up and running, get the credentials and connect your EC2 instance using a MySQL client.
Step 1: Create an EC2-Instance for accessing the database.
Step 2: Create an IAM Role and Give Permission to Access the database from EC2-Instance.
Step 3: Verify that the role is created successfully.
Step 4: Attach that role with the EC2 Instance.
Step 5: Select the role name and Click on Update IAM Role.
Step 6: Create a database, and select MySQL.
Step 7: Give the name of the database, username, and password (Please remember the whole info).
Now Database is created successfully and it is in an available state.
Step 8: Install MySQL-Server on EC2-Instance for accessing the MySQL-Client.
https://github.com/DevUnnati/AWS_EC2/blob/main/MySQL_Install_AWS.md
Step 9: Check whether MySQL is installed successfully or not.
Step 10: After getting the Version of MySQL, try to connect with the MySQL Client.
# connect to mysql client
sudo mysql -h database-1.cjmn0fa8hcg3.ap-south-1.rds.amazonaws.com -P 3306 -u admin -p
Congratulations!!, MySQL Client connects successfully to EC2-Instance.
Thank you for giving your precious time to read this blog/article and if any suggestions or improvements are required on my blogs feel free to connect on LinkedIn Unnati Gupta. Happy Learning 💥🙌***!!!***