Amazon RDS Overview
Managed relational database service. AWS handles the OS, patching, backups, and hardware — you handle the schema and query optimization.
- Engines: PostgreSQL, MySQL, MariaDB, Oracle, Microsoft SQL Server, IBM Db2.
- Instance Types:
- Standard (m-class): General purpose.
- Memory Optimized (r-class, x-class): Production databases under heavy load.
- Burstable (t-class): Dev/test or low traffic.
- Storage Types:
- General Purpose SSD (
gp2/gp3): Cost effective, transactional workloads. - Provisioned IOPS SSD (
io1/io2): High performance, low latency, mission critical. - Magnetic: Legacy — avoid in exam answers unless cost is the only stated factor.
- General Purpose SSD (
- Storage Auto Scaling: RDS can grow storage automatically with no downtime. You must set a maximum limit.
Read Replicas vs Multi-AZ
This is a guaranteed exam topic.
| Feature | Read Replicas | Multi-AZ (Standby) |
|---|---|---|
| Primary goal | Scalability — offload reads | High availability / DR |
| Replication | Asynchronous (eventual consistency) | Synchronous (strong consistency) |
| Active/Passive | All active — primary writes, replicas read | Active primary, passive standby |
| Failover | Manual — you promote a replica | Automatic — DNS repoints to the standby |
| Traffic | Serves READ ONLY traffic | Standby serves no traffic — it sits idle |
| Scope | Cross-AZ or cross-Region | Within a region (spans 2 AZs) |
| Backups | Usually taken from the primary | Taken from the standby, avoiding I/O suspension |
Numbers to remember:
- Read replicas: up to 15 for MySQL, MariaDB, and PostgreSQL. Up to 5 for Oracle.
- Multi-AZ: typically 1 standby (2 copies total).
Important (Exam Tip)
“Improve performance of a read heavy analytics application” → Read Replicas.
“Fault tolerance / survive a data center failure” → Multi-AZ.
There is a newer “Multi-AZ with two readable standbys” option, but if a question just says Multi-AZ, assume classic active/passive where the standby takes no traffic.
RDS Custom (Oracle & SQL Server)
For legacy applications that need access to the underlying OS or custom agents installed on the DB server.
| Standard RDS | RDS Custom | |
|---|---|---|
| SSH/RDP access | No | Yes |
| OS patching | AWS | You |
| Engines | All supported engines | Oracle and Microsoft SQL Server only |
Because you have OS access, AWS pauses its automation if your changes interfere with their hooks.
Amazon Aurora
AWS native relational database, MySQL and PostgreSQL compatible.
Storage — the interesting part
- Data lives in a shared cluster volume, not local EBS.
- 6 copies across 3 AZs.
- Self healing: bad disk blocks are isolated automatically.
- Auto expanding: storage grows on its own, up to 128 TB.
Availability & Replicas
| Operation | Requires |
|---|---|
| Write availability | 4 of 6 copies |
| Read availability | 3 of 6 copies |
- Aurora Replicas: up to 15, with auto scaling.
- If the master fails, a replica is promoted automatically in under 30 seconds.
Endpoints
| Endpoint | Points At | Use For |
|---|---|---|
| Cluster (Writer) | The single primary instance | All writes |
| Reader | Load balanced across all read replicas | Reporting, analytics |
| Custom | A chosen subset of instances | Separating “analytics nodes” from “web nodes” |
Aurora — Advanced Concepts
Aurora Serverless
Automatic scaling for intermittent or unpredictable workloads. No instance provisioning; pay per second (v2) or per minute (v1).
Scenario: “A startup’s database is hammered for 2 hours a day and idle the rest of the time.” → Aurora Serverless.
Aurora Global Database
- Physical replication at the storage layer, with cross region latency under 1 second.
- Supports up to 10 secondary regions (older material says 5).
- Cross region DR: promote a secondary region to primary in under a minute.
Scenario: “Mission critical app requires RPO under 1 second and RTO under 1 minute across regions.”
Other Aurora Features
| Feature | What it does |
|---|---|
| Backtrack | Rewind the database to a point in time without restoring a backup. Aurora MySQL only. |
| Aurora Machine Learning | Add ML predictions via plain SQL. Integrates with SageMaker (any model) and Comprehend (sentiment analysis). |
| Babelfish | Lets Aurora PostgreSQL understand T-SQL and listen on port 1433, so SQL Server apps migrate with minimal refactoring. |
Backups, Monitoring & Maintenance
Backup Architecture
| RDS | Aurora | |
|---|---|---|
| Mechanism | Snapshots of the storage volume | Continuous streaming to S3 |
| Performance impact | Single-AZ may briefly suspend I/O. Multi-AZ takes it from the standby. | Zero — no I/O freeze |
| Restore | Point in Time Recovery | PITR, and faster than RDS |
Database Cloning (Aurora only)
Creates a new cluster from an existing one using copy-on-write. It is instant, and you only pay for the changes the clone makes.
Scenario: “Spin up a staging environment from production data immediately, without doubling storage cost.”
Monitoring Tools
| Tool | Level | Answers |
|---|---|---|
| CloudWatch | Hypervisor | CPU, network, disk I/O. Cannot see which query is to blame. |
| Enhanced Monitoring | OS (agent) | Memory, swap, and the process list — down to 1 second granularity. |
| Performance Insights | Database | DB Load (AAS), wait events, top SQL queries. |
Important (Exam Tip)
“The database is slow and CPU is at 100% — which SQL query is responsible?” → Performance Insights.
“Which OS process is eating the CPU?” → Enhanced Monitoring.
Maintenance Windows
Required for engine upgrades and OS patching. On RDS Multi-AZ: the standby is patched first, then a failover happens, then the old primary is patched — so you only take a brief failover blip.
RDS Security
- Encryption at rest: Set at creation using KMS (AES-256). You cannot encrypt an existing unencrypted DB in place — snapshot it, copy the snapshot as encrypted, then restore.
- Encryption in transit: SSL/TLS, enforced through parameter groups (
rds.force_ssl=1) or SQL commands. - IAM Database Authentication: Use a short lived IAM token (15 minutes) instead of a DB password. Ideal for Lambda and EC2 — it removes hardcoded credentials entirely.
- Security Groups: Control network access — allow port 3306/5432 from the app’s security group.
RDS Proxy
- Problem: Opening and closing DB connections is expensive. High concurrency apps (especially Lambda) exhaust the connection limit — a “connection storm”.
- Solution: RDS Proxy sits between app and database.
- Connection pooling: Reuses existing connections.
- Failover: Cuts Aurora failover time by up to 66% by bypassing DNS propagation.
- Keywords: “Lambda”, “too many connections”, “connection timeout”, “reduce failover time”.
ElastiCache
Managed in-memory caching (Redis and Memcached) that offloads read heavy work from your database.
Redis vs Memcached
| Feature | Redis | Memcached |
|---|---|---|
| Data types | Complex — strings, lists, sets, sorted sets, hashes, bitmaps | Simple — strings, objects |
| Persistence | Yes (AOF/RDB) — survives reboot | No — data lost on reboot |
| Availability | Multi-AZ with auto failover | No Multi-AZ (sharding only) |
| Scaling | Read replicas and clustering | Multithreaded, scale up/out |
| Features | Pub/Sub, geospatial, transactions, leaderboards | Simple caching |
| Compliance | HIPAA, FedRAMP | HIPAA, FedRAMP |
Important (Exam Tip)
“Leaderboards”, “sorting”, “persistence”, “advanced data types” → Redis.
“Simple multithreaded object cache” → Memcached.
Caching Strategies
| Strategy | How it works | Pros | Cons |
|---|---|---|---|
| Lazy Loading (Cache-Aside) | App checks the cache; on a miss it queries the DB, writes to cache, and returns. | Only requested data is cached. A node failure is not fatal. | Cache miss penalty (3 network calls). Data can go stale. |
| Write-Through | App writes to the DB and cache at the same time. | Data is never stale. Fast reads. | Slower writes. Memory wasted on data nobody reads. |
Use Case: Session Store
A stateless web app across many EC2 instances needs somewhere to keep login sessions.
- DynamoDB: works, but higher latency than a cache.
- ElastiCache (Redis): sub millisecond latency, and a TTL auto expires old sessions.
If the requirement says “global” or “cross region” caching → Redis Global Datastore.
Crucial Exam Extras
AWS Secrets Manager
Stores DB credentials outside your code. The key feature is automatic rotation — Secrets Manager rotates the password in RDS and hands the new one to the application with no involvement from you.
Keywords: “rotate credentials”, “remove hardcoded passwords”, “retrieve secrets automatically”.
Automated Backups vs Manual Snapshots
| Automated Backups | Manual Snapshots | |
|---|---|---|
| Enabled | By default | User initiated |
| Retention | 1 to 35 days (0 disables) | Indefinite — never expire |
| PITR | Yes | No |
| On instance deletion | Deleted, unless you retain a final backup | Persist |
Scenario: “Keep database backups for 5 years for auditing.” → Manual snapshots or AWS Backup, since automated backups cap at 35 days.
Parameter Groups: Static vs Dynamic
- Dynamic: Changes apply immediately.
- Static: Changes require a manual reboot to take effect.
Scenario: “You updated a parameter to enable logging but nothing is being logged.” → It was a static parameter and the instance was never rebooted.
Database Migration Service (DMS)
Migrates databases into AWS while the source stays operational, so downtime is minimal.
| Migration | Meaning | Tooling |
|---|---|---|
| Homogeneous | Same engine (MySQL → RDS MySQL) | DMS alone |
| Heterogeneous | Different engine (SQL Server → Aurora) | SCT (Schema Conversion Tool) to convert the schema, then DMS |