RDS: Managed Databases

RDS (Relational Database Service) runs a managed database for you — PostgreSQL, MySQL, and others — handling the parts of running a database that have nothing to do with your actual application: patching, backups, failover, and storage scaling.

What "managed" saves you from doing

Running your own database on an EC2 instance means you're responsible for installing it, applying security patches, configuring backups, monitoring disk space, and setting up replication if you want high availability. RDS handles all of that as part of the service:

bash terminal
aws rds create-db-instance \
  --db-instance-identifier my-app-db \
  --db-instance-class db.t3.micro \
  --engine postgres \
  --master-username admin \
  --master-user-password ******** \
  --allocated-storage 20
Output (abridged)
{
    "DBInstance": {
        "DBInstanceIdentifier": "my-app-db",
        "Engine": "postgres",
        "DBInstanceStatus": "creating"
    }
}

Automated backups and Multi-AZ

RDS takes automated daily backups and lets you restore to any point within a retention window (up to 35 days) — useful when a bad migration or an accidental DELETE needs to be undone. Enabling Multi-AZ keeps a synchronized standby copy of your database in a different availability zone, which RDS automatically fails over to if the primary has a problem — with no application changes required.

Backups and Multi-AZ solve different problems: Multi-AZ protects against infrastructure failure (a data center going down) but a standby copy faithfully replicates a mistake too — if you drop a table, the standby drops it as well, instantly. Backups (and point-in-time restore) are what actually protect you from a human or application-level mistake, not Multi-AZ.

Connecting from your application

An RDS instance normally lives in a private subnet, reachable only from resources inside the same VPC (like an EC2 instance or a Lambda function configured for VPC access) — not from the open internet, following the same private-subnet pattern from the VPC lesson.