Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 16: Amazon RDS

16.1 Why RDS instead of MySQL on EC2

In Chapter 10 the database and the website share one virtual machine. That is the right way to learn SQL. In a real project you usually do not want the data to live and die with that one server. Amazon RDS (Relational Database Service) runs a relational database for you.

MySQL or MariaDB on EC2 (Chapters 10–12) Amazon RDS
Who installs and patches the engine You, with yum or apt AWS
Backups You run mysqldump, or you snapshot the EBS volume Automated backups and point-in-time restore
Disk full, failover, Multi-AZ You design it Built in (you turn it on)
SQL, tables, indexes, users You You. This does not change
Where it runs On your instance On AWS-managed hosts, in subnets you choose

What you still manage: the schema and the queries, the master password, the security group, and the connection string in the application. You do not SSH into RDS and edit my.cnf. Engine settings go in a parameter group (section 16.9).

Ravindra Bagale's Tip

Many students say "I installed MySQL, so the data is on my server." Look: with RDS the data is on a different machine, in a different subnet. Your EC2 only has the client and the password. If the security group does not allow port 3306, the database can be healthy and the app still cannot reach it. The security group is the door. Pay attention!