Amazon RDS and Aurora for Beginners: Managed Relational Databases, Multi-AZ, Read Replicas and Backups
Relational Databases in 2 Minutes
A relational database stores data in tables with rows and columns, and uses SQL to read and change data. Tables are linked by keys. Examples: customers, orders, products.
sql
CREATE TABLE customers (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(80), email VARCHAR(120));
INSERT INTO customers (name, email) VALUES ('Asha', 'asha@example.com');
SELECT id, name FROM customers WHERE email LIKE '%@example.com';
What Is Amazon RDS?
Amazon Relational Database Service (RDS) is a managed service that runs relational databases for you. AWS handles hardware, installation, patching, backups and failover. You manage the schema, queries, users and settings.
| Supported engines | Notes |
| MySQL, MariaDB, PostgreSQL | Open source, very popular |
| Oracle, Microsoft SQL Server, Db2 | Commercial engines, license included or bring your own |
| Amazon Aurora (MySQL and PostgreSQL compatible) | AWS-built cloud database, faster and more resilient |
| RDS manages | You manage |
| Server hardware and operating system | Database design (tables, indexes) |
| Database software installation and patching | SQL queries and performance |
| Automated backups and recovery | Users and permissions inside the database |
| Multi-AZ failover | Security group rules and encryption choices |
| Monitoring metrics | Instance size and settings |
Limits of RDS You cannot SSH into the server or access the OS. If you need OS-level control you can run a database on EC2 yourself, but then you manage everything.
Create a Database: Key Choices
| Choice | Beginner guidance |
| Engine and version | MySQL or PostgreSQL, a current supported version |
| Template | Dev/Test or Free tier to learn. Production for Multi-AZ |
| Instance class | db.t3.micro or db.t4g.micro for learning, bigger for production |
| Storage | gp3. Turn on storage autoscaling |
| Credentials | Use Manage master password in Secrets Manager |
| VPC and subnet group | Private subnets in at least two AZs |
| Public access | No. Keep databases private |
| Security group | Allow the database port (3306 MySQL, 5432 PostgreSQL) only from your app's security group |
| Encryption | Turn on (KMS) |
| Backups | Retention 7 days or more |
bash
aws rds create-db-instance --db-instance-identifier demo-db --engine mysql --db-instance-class db.t3.micro \
--allocated-storage 20 --storage-type gp3 --master-username admin --manage-master-user-password \
--vpc-security-group-ids sg-0db --db-subnet-group-name private-subnets --no-publicly-accessible --storage-encrypted --backup-retention-period 7
aws rds describe-db-instances --db-instance-identifier demo-db --query 'DBInstances[0].[DBInstanceStatus,Endpoint.Address]'
# From an app server in the VPC:
mysql -h demo-db.abc123.ap-south-1.rds.amazonaws.com -u admin -p
High Availability: Multi-AZ
- Multi-AZ keeps a standby copy in another AZ using synchronous replication
- If the primary fails, RDS fails over automatically (about 1-2 minutes) and the same endpoint name points to the new primary
- The standby is for availability, you cannot read from it in the classic mode (Multi-AZ DB cluster has readable standbys)
- Use Multi-AZ for production
Read Replicas: Scale Reads
- A read replica is a copy that answers read queries to take load off the primary
- Replication is asynchronous, so data can be slightly behind
- Can be in another Region and can be promoted to a standalone database
- Applications must send reads to the replica endpoint
| Multi-AZ | Read replica |
| Purpose | High availability and failover | Performance (read scaling) and DR |
| Replication | Synchronous | Asynchronous |
| Readable | Not in the classic setup | Yes |
| Failover | Automatic | Manual promotion |
Backups and Restore
- Automated backups: daily snapshot plus transaction logs, kept 1-35 days. Allows point-in-time restore
- Manual snapshots: kept until you delete them. Can be copied and shared
- A restore always creates a new database instance with a new endpoint
bash
aws rds create-db-snapshot --db-instance-identifier demo-db --db-snapshot-identifier demo-before-change
aws rds restore-db-instance-to-point-in-time --source-db-instance-identifier demo-db --target-db-instance-identifier demo-db-restored --use-latest-restorable-time
Amazon Aurora
- Compatible with MySQL and PostgreSQL, built for the cloud
- Storage is replicated 6 times across 3 AZs and grows automatically (up to 128 TiB)
- Up to 15 read replicas, fast failover (about 30 seconds)
- Often up to 3-5 times faster than standard open-source engines (AWS claims)
- Aurora Serverless v2 adjusts capacity automatically for variable workloads
- Aurora Global Database replicates to other Regions for disaster recovery
- Costs more than basic RDS, but gives better performance and resilience
Other Good-to-Know Features
- RDS Proxy: pools connections, helps Lambda and busy apps
- Parameter groups: engine settings (restart needed for static ones)
- Maintenance windows: when patches are applied
- Performance Insights: shows which SQL is slow
- Enhanced Monitoring and CloudWatch metrics: CPU, memory, connections, free storage
- IAM database authentication and Secrets Manager rotation
- Blue/green deployments: safer upgrades
Pricing in Simple Words
| You pay for | Notes |
| Instance hours | Based on class. Multi-AZ doubles the instance cost |
| Storage and IOPS | Per GB per month (and extra IOPS) |
| Backup storage beyond the free amount | Equal to your database size |
| Data transfer out | Between Regions or to the internet |
| Stop option | You can stop a database for up to 7 days to save compute cost (storage still charged) |
When to Use RDS
| Use RDS/Aurora when | Use something else when |
| Data is structured with relationships and you need SQL and transactions | Data is simple key-value at huge scale (DynamoDB) |
| You want less admin work than running a database on EC2 | You need OS-level or custom plugins (EC2) |
Practice
- Create a MySQL
db.t3.micro in private subnets and connect from an EC2 instance
- Create a table, insert rows and query them
- Take a snapshot and do a point-in-time restore to a new instance
- Create a read replica and compare endpoints
- Delete the practice database and snapshots
Conclusion
RDS runs managed relational databases: AWS handles servers, patching, backups and failover while you manage data and queries. Use Multi-AZ for availability, read replicas for read scaling, snapshots for backups, and Aurora for higher performance and resilience.
Quick Summary: relational basics; RDS; creating; Multi-AZ; read replicas; backups; Aurora; features; pricing; fit.