Amazon RDS and Aurora: Multi-AZ, Read Replicas, Backups, RDS Proxy and Aurora Global Database
Managed Relational Databases
Amazon RDS (Relational Database Service) runs popular SQL engines for you. AWS handles provisioning, patching, backups, failover and monitoring. You manage schema, queries, users and performance tuning. You cannot log in to the underlying OS (except RDS Custom).
| Engine | Notes |
| MySQL, MariaDB, PostgreSQL | Open-source engines, widely used |
| Oracle, SQL Server | Commercial engines. License included or bring your own (BYOL) |
| Db2 | IBM Db2 engine option |
| Amazon Aurora | AWS-built MySQL- and PostgreSQL-compatible engine with a cloud-native storage layer |
| RDS Custom | Oracle and SQL Server with OS and database customization access |
Multi-AZ: High Availability
| Option | How it works | Failover | Readable standby? |
| Multi-AZ instance deployment | A synchronous standby copy in another AZ. One DNS endpoint | Automatic, usually 60-120 seconds | No. Standby is only for failover |
| Multi-AZ DB cluster (MySQL and PostgreSQL) | One writer and two readable standbys in 3 AZs, semi-synchronous | Usually under 35 seconds | Yes (reader endpoint) |
- Multi-AZ protects against AZ failure, instance failure and patching downtime. It is not for scaling reads (use read replicas)
- Failover happens by switching the DNS name of the endpoint. Your app must reconnect, use short DNS caching
- Triggers: AZ outage, primary failure, instance type change, OS patching, manual reboot with failover
Read Replicas: Scale Reads
- Asynchronous copies. Up to 15 replicas (Aurora) or 5 (other engines)
- Each replica has its own endpoint: the application must send reads there
- Can be in the same AZ, another AZ or another Region (cross-Region replicas help DR and local reads)
- Can be promoted to a standalone database
- Replication lag exists: reads may be slightly stale (eventual consistency)
- Good for reporting and analytics so heavy queries do not slow the primary
| Multi-AZ | Read Replica |
| Purpose | High availability | Read scaling (and DR) |
| Replication | Synchronous | Asynchronous |
| Accessible for reads | No (instance deployment) | Yes |
| Failover | Automatic | Manual promotion |
| Network cost | No charge inside Region | Charged for cross-Region data transfer |
bash
aws rds create-db-instance --db-instance-identifier shop-db --engine postgres --engine-version 16.4 \
--db-instance-class db.m7g.large --allocated-storage 100 --storage-type gp3 --storage-encrypted --kms-key-id alias/app-data \
--master-username dbadmin --manage-master-user-password \
--multi-az --db-subnet-group-name shop-db-subnets --vpc-security-group-ids $DB_SG \
--backup-retention-period 14 --enable-performance-insights --deletion-protection --no-publicly-accessible
aws rds create-db-instance-read-replica --db-instance-identifier shop-db-ro1 --source-db-instance-identifier shop-db --db-instance-class db.m7g.large
aws rds create-db-instance-read-replica --db-instance-identifier shop-db-dr --source-db-instance-identifier arn:aws:rds:ap-south-1:123456789012:db:shop-db --region eu-west-1 --kms-key-id alias/dr-key
Check engine versions: Use aws rds describe-db-engine-versions --engine postgres to list versions currently supported before you create a database.
Backups and Recovery
| Type | Details |
| Automated backups | Daily snapshot + transaction logs. Retention 0 to 35 days (0 disables). Allows point-in-time recovery (PITR) to any second in the retention window (to a new instance) |
| Manual snapshots | Kept until you delete them. Can be copied to other Regions and shared with other accounts |
| Restore | Always creates a new DB instance (new endpoint). You cannot restore in place |
| Final snapshot / deletion protection | Prevent accidents |
| AWS Backup | Central policies, cross-Region and cross-account copies |
bash
aws rds restore-db-instance-to-point-in-time --source-db-instance-identifier shop-db --target-db-instance-identifier shop-db-restore --restore-time 2026-11-17T08:30:00Z
aws rds create-db-snapshot --db-instance-identifier shop-db --db-snapshot-identifier shop-pre-upgrade
aws rds copy-db-snapshot --source-db-snapshot-identifier arn:aws:rds:ap-south-1:123456789012:snapshot:shop-pre-upgrade --target-db-snapshot-identifier shop-pre-upgrade-dr --region eu-west-1 --kms-key-id alias/dr-key
Security
- Place the DB in private subnets using a DB subnet group (at least two AZs). Not publicly accessible
- Security group: allow the DB port only from the app security group
- Encryption at rest with KMS (chosen at creation. To encrypt an existing DB: snapshot → copy with encryption → restore)
- TLS for connections (download the RDS CA bundle, set
require_ssl)
- IAM database authentication (short-lived tokens) and Secrets Manager rotation for passwords (
--manage-master-user-password does it for you)
- Parameter groups change engine settings. Option groups add features (Oracle, SQL Server)
RDS Proxy
- A managed connection pooler between the app and RDS/Aurora
- Great for Lambda (many short-lived connections) and for apps with connection spikes
- Reduces failover time by keeping connections (often by up to 66 percent)
- Supports IAM authentication and stores credentials in Secrets Manager
- Must be in the same VPC, not publicly accessible
Amazon Aurora
Aurora separates compute from storage. The cluster volume is a shared, distributed, self-healing storage layer replicated 6 copies across 3 AZs, growing automatically up to 128 TiB. It is MySQL- and PostgreSQL-compatible and offers up to 5x MySQL and 3x PostgreSQL throughput (AWS-stated figures).
text
Aurora cluster
├─ Writer instance (primary) ← cluster endpoint (writes)
├─ Reader instance 1 (up to 15) ← reader endpoint (load balanced reads)
└─ Reader instance 2
Shared cluster volume: 6 copies across 3 AZs, auto-repair, continuous backup to S3
| Aurora feature | Details |
| Failover | A reader is promoted, usually under 30 seconds (faster with RDS Proxy). Set failover priority per replica |
| Endpoints | Cluster (writer), reader (load balanced), custom and instance endpoints |
| Replicas share storage | Replica lag is typically milliseconds |
| Backtrack (MySQL) | Rewind the cluster to a past time without restoring |
| Cloning | Fast, space-efficient copy-on-write clone for testing |
| Backups | Continuous, up to 35 days, no performance impact |
| Aurora Serverless v2 | Capacity scales in small steps in ACUs (Aurora Capacity Units), can scale to zero (pause) on supported versions. Good for variable or unpredictable load, dev/test |
| Aurora Global Database | One primary Region and up to 5 secondary Regions with storage-based replication, typically under 1 second lag. RPO about 1 second, RTO about 1 minute for Region failover. Local fast reads worldwide |
| Aurora I/O-Optimized | Pricing option with no per-I/O charge. Good for I/O-heavy workloads |
| Aurora ML, zero-ETL to Redshift, Data API | Integrations |
bash
aws rds create-db-cluster --db-cluster-identifier shop-aurora --engine aurora-postgresql --master-username dbadmin --manage-master-user-password \
--db-subnet-group-name shop-db-subnets --vpc-security-group-ids $DB_SG --storage-encrypted --backup-retention-period 14 \
--serverless-v2-scaling-configuration MinCapacity=0.5,MaxCapacity=16
aws rds create-db-instance --db-instance-identifier shop-aurora-1 --db-cluster-identifier shop-aurora --engine aurora-postgresql --db-instance-class db.serverless
aws rds create-db-instance --db-instance-identifier shop-aurora-2 --db-cluster-identifier shop-aurora --engine aurora-postgresql --db-instance-class db.serverless --availability-zone ap-south-1b
RDS vs Aurora: Choosing
| Choose | When |
| RDS (standard engine) | Need Oracle or SQL Server, simple workloads, tight budget, lift-and-shift |
| Aurora | Need high availability and fast failover, many read replicas, big growth, global reads, high throughput, less storage planning |
| Aurora Serverless v2 | Spiky or unknown load, many small databases |
| DynamoDB (next lesson) | Key-value access at any scale with single-digit millisecond latency, no joins |
Operations
- Maintenance windows for patches. Minor version auto-upgrade is optional
- Performance Insights shows top SQL and waits. Enhanced Monitoring gives OS metrics. CloudWatch alarms on
CPUUtilization, FreeableMemory, DatabaseConnections, ReplicaLag, FreeStorageSpace
- Storage autoscaling for RDS (
--max-allocated-storage)
- Blue/green deployments let you test a major upgrade or schema change on a green copy and switch with a short downtime
- Stop an instance up to 7 days for dev/test to save money
Practice Tasks
- Create a Multi-AZ PostgreSQL instance in private subnets and force a failover with
aws rds reboot-db-instance --force-failover
- Create a read replica and connect an app to both endpoints
- Do a point-in-time restore to a new instance and compare data
- Create an Aurora cluster with two instances and test the reader endpoint
- Explain the difference between RPO and RTO for Aurora Global Database
Conclusion
Use RDS Multi-AZ for high availability, read replicas to scale reads and for cross-Region DR, automated backups and PITR for recovery, and RDS Proxy for connection management. Aurora adds a six-copy shared storage layer, up to 15 fast replicas, Serverless v2 and Global Database for low-RPO multi-Region designs.
Quick Summary: RDS engines; Multi-AZ instance vs cluster; read replicas vs Multi-AZ; backups/PITR/snapshots; security; RDS Proxy; Aurora architecture + features; RDS vs Aurora; operations.