Practice Questions and Lab Exercises
Now do this lab yourself. When you finish, delete the instance and delete the manual snapshot too.
चला, आता हा lab स्वतः करा. संपल्यावर instance delete करा आणि manual snapshot पण delete करा.
चलो, अब यह lab खुद करो. खत्म होने पर instance delete करो और manual snapshot भी delete करो.
- Give three jobs RDS does for you, and three jobs that stay with you.
- Why must a DB subnet group have subnets in two Availability Zones even for a single-AZ database?
- Which package installs the MySQL client on Amazon Linux 2023, on Ubuntu, and on CentOS Stream 9? Which package must you not install if you only want the client?
- Why does the application store the RDS endpoint, and not the IP address that name resolves to?
- A restore succeeded, but the website still shows the old data on the old host. What was missed?
- Explain Multi-AZ and a read replica in four lines, including what happens to the endpoint.
- Lab: Create the MySQL instance from section 16.3 (public access No, gp3, autoscaling off, deletion protection off). Restrict port 3306 to your EC2 security group. From EC2, install the client and run the
studentstable. Change one Chapter 10 application'sDB_HOSTto the endpoint and read a row through the website. Take a manual snapshot, then stop the instance. When the lab is finished, delete the instance without a final snapshot, and delete the manual snapshot.
Understood? RDS is a managed database: you write the SQL, AWS handles backups and patches, and the endpoint and the security group stay in your hands. Now repeat the lab without looking at the notes.
समजला का? RDS म्हणजे managed database: तुम्ही SQL लिहिता, AWS backup आणि patch करतो, आणि endpoint आणि security group तुमच्या हाती. आता हा lab notes बघितल्याशिवाय परत करा.
समझ आए? RDS मतलब managed database: आप SQL लिखते हो, AWS backup और patch करता है, और endpoint और security group तुम्हारे हाथ में रहते हैं. अब यह lab notes देखे बिना दोबारा करो.
Quick Revision
- RDS is managed MySQL, MariaDB, PostgreSQL, Oracle, SQL Server, or Aurora. You still write SQL. The lab is MySQL on gp3, in a DB subnet group, not on the EC2 disk.
- Create: identifier
appdb, master useradmin(neverrdsadmin),db.t3.microordb.t4g.microonly if the free-tier note on the page says so, public access No, port 3306 only from the EC2 security group, initial databaseappdb, deletion protection off for the lab. - Connect:
sudo yum install -y mariadb105on Amazon Linux 2023,sudo apt install -y mysql-clienton Ubuntu,sudo yum install -y mariadbon CentOS, thenmysql -h ENDPOINT -P 3306 -u admin -p appdb. - Applications: change the host from
127.0.0.1to the endpoint (PHP DSN, Flask and NodeDB_HOST, WordPressDB_HOST). Create users on RDS.wpuser@localhostis not copied across. - An automated backup gives point-in-time restore inside the retention window. A manual snapshot lasts until you delete it. Restore creates a new instance and a new endpoint. The snapshot is data, not the parameter group or the option group.
- Multi-AZ is a synchronous standby on the same endpoint, for failover. A read replica is asynchronous, has its own endpoint, and can be promoted.
- Stop: storage is still charged, and the instance starts again after 7 days. Delete the lab instance without a final snapshot, then delete manual snapshots.