RDS in One Page
Amazon RDS runs managed relational databases: MySQL, PostgreSQL, MariaDB, Oracle, SQL Server and Db2. Amazon Aurora is AWS's cloud-built MySQL- and PostgreSQL-compatible engine. AWS handles hardware, OS patching, backups and failover. You handle schema, queries, access and tuning. You cannot SSH into the host (RDS Custom is the exception).
| Feature | What it gives you |
|---|---|
| Multi-AZ | Synchronous standby in another AZ with automatic failover (high availability, not for reads in classic Multi-AZ) |
| Read replicas | Asynchronous copies for read scaling, can be in another Region, can be promoted. Up to 15 for Aurora, 15 for MySQL/PostgreSQL on RDS |
| Automated backups | Daily snapshot plus transaction logs. Point-in-time restore within retention of 1 to 35 days |
| Manual snapshots | Kept until you delete them. Can be copied and shared |
| Storage autoscaling | Grows storage automatically up to a limit |
| Encryption | KMS at rest (choose when creating; encrypt later via snapshot copy). SSL/TLS in transit |
Endpoints Matter
| Engine | Endpoint | Use |
|---|---|---|
| RDS instance | One DNS name that always points to the current primary (changes during failover, so respect DNS TTL) | Read and write |
| Aurora cluster (writer) endpoint | Always the current writer | Writes |
| Aurora reader endpoint | Load-balances across Aurora replicas | Reads |
| Aurora custom endpoints | A chosen subset of instances | Reporting group, different instance sizes |
| RDS Proxy endpoint | Pooled connections in front of the database | Lambda and many short clients |
Never hard-code an instance IP. Use the endpoint, keep short DNS caching in your driver, and retry on connection errors during failover (typically around a minute for RDS Multi-AZ, usually shorter for Aurora).
Connecting from Code
- Always use parameterized queries (
%splaceholders) to prevent SQL injection - Never store passwords in code. Read them from Secrets Manager (supports automatic rotation for RDS) or use IAM authentication
- Verify the server certificate using the RDS CA bundle
The Lambda Connection Problem and RDS Proxy
Each concurrent Lambda environment opens its own database connection. A traffic spike of 1,000 concurrent executions can open 1,000 connections and exhaust the database (a small instance may allow only a few hundred). RDS Proxy fixes this.
- Runs in your VPC, so the Lambda function must be in the VPC as well
- Supports MySQL, PostgreSQL, MariaDB and SQL Server engines (check the list for your version)
- Watch for pinning (session-level state like temporary tables or
SETstatements force a client to hold one connection) - Alternatives for HTTP-style access: the RDS Data API for Aurora Serverless (no connection management)
IAM Database Authentication
Instead of a stored password, the app asks AWS for a token valid for 15 minutes and uses it as the password. Access is controlled with IAM policy rds-db:connect. Works for MySQL, PostgreSQL and MariaDB with SSL required.
- Only new connections need a valid token; open connections continue
- Limit: connections per second with IAM auth is limited, so use a pool or RDS Proxy for very busy apps
Multi-AZ vs Read Replica Summary
| Multi-AZ (instance) | Read replica | |
|---|---|---|
| Purpose | High availability | Read scaling, DR across Regions |
| Replication | Synchronous | Asynchronous (replica lag) |
| Used for reads | No (Multi-AZ DB cluster option has readable standbys) | Yes |
| Failover | Automatic | Manual promotion (or automatic in Aurora) |
| Backups | Taken from the standby | Can have own backup settings |
| Endpoint | Same DNS name | Own endpoint. App must route reads |
Aurora Highlights
- Storage is a shared cluster volume replicated 6 ways across 3 AZs, growing automatically to 128 TiB
- Up to 15 low-lag replicas. Failover to a replica usually in under 30 seconds (priority tiers decide who is promoted)
- Aurora Serverless v2 scales capacity (ACUs) in small steps up and down automatically. Good for variable or new workloads
- Aurora Global Database: cross-Region replication under about a second for DR and local reads
- Backtrack (Aurora MySQL) rewinds the cluster without restoring a backup
- Cloning creates a fast copy-on-write copy for testing
- Aurora reads use the reader endpoint, writes the cluster endpoint
Backups and Restore
- Restore always creates a new instance or cluster (new endpoint). You then repoint the app, you do not restore in place
- Point-in-time restore to a second within the retention period (up to 35 days)
- Snapshots can be copied across Regions, shared and restored into other accounts
- Set deletion protection and take a final snapshot when deleting
Parameter Groups and Option Groups
- Parameter group: engine settings such as
max_connections, time zone orinnodb_buffer_pool_size. Static parameters need a reboot, dynamic parameters apply immediately - Option group: extra engine options (for example Oracle or SQL Server features)
- You cannot edit the default group. Create a custom one
Monitoring
- CloudWatch metrics:
CPUUtilization,DatabaseConnections,FreeableMemory,ReadLatency,ReplicaLag,FreeStorageSpace - Performance Insights shows top SQL and waits
- Enhanced Monitoring gives OS-level metrics
- Slow query log and error logs can export to CloudWatch Logs
- RDS events through SNS for failover, backup and maintenance
Choose RDS or DynamoDB?
| Need | Pick |
|---|---|
| Joins, transactions across many tables, SQL reporting, existing SQL app | RDS / Aurora |
| Key-based access at massive scale, serverless, flexible schema | DynamoDB |
| Variable relational workload | Aurora Serverless v2 |
Practice Tasks
- Create an Aurora MySQL or PostgreSQL cluster and connect with a client
- Store the credentials in Secrets Manager and read them from code
- Put an RDS Proxy in front and connect a Lambda function in the VPC
- Create a read replica and send reads to it
- Restore a point-in-time copy to a new instance and compare data
Conclusion
Use endpoints not IPs, keep credentials in Secrets Manager or use IAM authentication, parameterize queries, add RDS Proxy for Lambda and bursty clients, use Multi-AZ for availability and read replicas for read scale, restore into new instances, and watch connections, CPU and replica lag.

