Amazon Relational Database Service (RDS) Study Guide
Amazon RDS is a managed service that makes it easy to set up, operate, and scale a relational database in the AWS Cloud. It automates time-consuming administration tasks such as hardware provisioning, database setup, patching, and backups.
The “Managed Apartment” Analogy
Think of RDS like renting a luxury managed apartment. You (the developer) own the furniture and decide who visits (your data and queries). However, the landlord (AWS) handles the structural maintenance, plumbing (patching), security guards (firewalls/IAM), and even keeps a backup key (automated backups). This is different from “EC2 Database,” which is like building your own house from scratch—you’re responsible for everything from the foundation to the roof.
Core Architecture and Engines
RDS supports six familiar database engines:
- Open Source: MySQL, PostgreSQL, MariaDB.
- Commercial: Oracle, Microsoft SQL Server.
- Cloud Native: Amazon Aurora (MySQL and PostgreSQL compatible).
High Availability vs. Scalability
| Feature | Multi-AZ (High Availability) | Read Replicas (Scalability) |
|---|---|---|
| Primary Purpose | Disaster Recovery / Failover | Scaling Read Performance |
| Replication Type | Synchronous | Asynchronous |
| Scope | Usually 1 Standby in different AZ | Up to 15 (Aurora) or 5 (RDS) replicas |
| Endpoint | Single DNS (automatically points to Primary) | Unique DNS for each replica |
| Writes | Only on Primary | Only on Primary (Replicas are Read-Only) |
Storage and Performance
- General Purpose SSD (gp2/gp3): Balanced price/performance for most workloads.
- Provisioned IOPS SSD (io1): For low-latency, high-throughput applications (e.g., large OLTP).
- Storage Autoscaling: RDS can automatically increase storage capacity when it detects you are running out of space, without downtime.
Security and Monitoring
- Encryption at Rest: Handled via AWS KMS. Must be enabled at creation time.
- Encryption in Transit: Uses SSL/TLS certificates.
- Network Security: RDS instances should almost always be in Private Subnets, controlled by Security Groups.
- Authentication: Supports standard DB creds, IAM Database Authentication, and Kerberos.
Exam Tips and Gotchas
- Multi-AZ vs Read Replicas: If the exam asks for “Business Continuity” or “High Availability,” choose Multi-AZ. If it asks for “Performance” or “Scaling,” choose Read Replicas.
- RDS Custom: If a scenario requires access to the underlying Operating System (e.g., to install specific legacy drivers for Oracle or SQL Server), choose RDS Custom.
- Backups: Automated backups are deleted when the RDS instance is deleted. Manual Snapshots are retained even after instance deletion.
- The “I/O Freeze”: During a snapshot on a Single-AZ instance, I/O may be suspended for a few seconds. Multi-AZ instances avoid this by taking snapshots from the standby.
- RDS Proxy: Use this for Serverless apps (Lambda) to pool connections and prevent the “too many connections” error.
Decision Matrix / If–Then Guide
- If you need to scale reads for a global audience → Then use Cross-Region Read Replicas.
- If you need to automate failover within a region → Then enable Multi-AZ Deployment.
- If you need to run a non-relational, schema-less DB → Then RDS is the wrong choice (Use DynamoDB).
- If you have unpredictable, intermittent workloads → Then use Aurora Serverless.
Topics covered :
Summary of key subtopics covered in this guide:
- Managed service benefits vs. EC2 self-managed DBs.
- Supported DB engines and RDS Custom.
- Multi-AZ synchronous replication for HA.
- Read Replicas asynchronous replication for scaling.
- Storage types (GP3 vs IO1) and Autoscaling.
- Security (KMS, IAM, VPC isolation).
- RDS Proxy for connection pooling.
Service Ecosystem
- IAM: Control who can manage RDS instances.
- KMS: Manages keys for storage encryption.
- CloudWatch: Monitor CPU, Memory, and Freeable Space.
- CloudTrail: Audit API calls (Who deleted the DB?).
Performance & Scaling
- Vertical: Change instance type (e.g., t3.micro to m5.large).
- Horizontal: Add Read Replicas (up to 5 for RDS, 15 for Aurora).
- RDS Proxy: Essential for Lambda to handle connection bursts.
Cost Optimization
- Reserved Instances: Up to 60% discount for 1 or 3-year commitments.
- Stop/Start: Stop instances for up to 7 days when not in use (Dev/Test).
- Aurora Serverless: Pay-per-second for unpredictable workloads.
Production Use Case: E-Commerce Platform
Use Amazon Aurora with Multi-AZ for the primary product catalog to ensure zero data loss. Deploy Read Replicas in multiple regions to provide low-latency product browsing for global customers. Use RDS Proxy to manage connections from frontend Lambda functions during “Flash Sale” traffic spikes.