Most applications need a relational database, and RDS removes the undifferentiated work of running one.
Amazon RDS runs relational engines (PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, Db2) for you. You choose the engine, instance class and storage; AWS handles provisioning, OS and engine patching in maintenance windows, automated backups and monitoring. You don't get OS access.
Networking: create a DB subnet group of private subnets in at least two AZs, keep the database not publicly accessible, and allow the port only from the application's security group. Connect using the endpoint hostname, never an IP, because the IP changes during failover.
Availability and scaling are separate features:
- Multi-AZ keeps a synchronous standby in another AZ. If the primary or its AZ fails, RDS fails over automatically (typically in a minute or two) and the endpoint points to the new primary. In the classic instance deployment the standby serves no reads; a Multi-AZ DB cluster adds two readable standbys.
- Read replicas are asynchronous copies, possibly in other Regions, that serve read traffic. They can lag, and you can promote one to a standalone database.
Backups: automated backups with point-in-time restore (retention up to 35 days) plus manual snapshots kept until you delete them. Restores always create a new instance.
Other essentials: --manage-master-user-password keeps the admin password in Secrets Manager; parameter groups hold engine settings; storage autoscaling grows disks; RDS Proxy pools connections, which matters for Lambda and other bursty clients; and deletion protection prevents accidents.
Example
aws rds create-db-subnet-group --db-subnet-group-name app-db \
--db-subnet-group-description "Private DB subnets" \
--subnet-ids subnet-db-a subnet-db-b
aws rds create-db-instance --db-instance-identifier orders-db \
--engine postgres --db-instance-class db.m7g.large \
--allocated-storage 100 --storage-type gp3 --storage-encrypted \
--multi-az --no-publicly-accessible \
--master-username app --manage-master-user-password \
--db-subnet-group-name app-db --vpc-security-group-ids sg-db \
--backup-retention-period 7 --deletion-protection
aws rds wait db-instance-available --db-instance-identifier orders-db
aws rds describe-db-instances --db-instance-identifier orders-db \
--query 'DBInstances[0].Endpoint.Address' --output text
# orders-db.c1abc2def3gh.eu-west-1.rds.amazonaws.com
aws rds create-db-instance-read-replica --db-instance-identifier orders-db-ro \
--source-db-instance-identifier orders-dbRemember
- RDS manages patching, backups and failover; you manage schema, queries and access
- Multi-AZ is for availability; read replicas are for read scaling
- Private subnets, SG-to-SG access, connect by endpoint name
- Point-in-time restore creates a new instance
Watch out for
- Expecting the classic Multi-AZ standby to serve read traffic; use read replicas for that.