RDS and Database Services
Amazon RDS (Relational Database Service) makes it easy to set up, operate, and scale a relational database in the cloud. It handles routine database tasks like provisioning, patching, backup, recovery, and scaling.
RDS Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RDS DEPLOYMENT β
β β
β Single-AZ: Multi-AZ: β
β ββββββββββββββ ββββββββββββββ β
β β Primary β β Primary β β
β β Instance β β (AZ-a) β β
β β (AZ-a) β ββββββββ¬ββββββ β
β ββββββββββββββ β Sync β
β β Replication β
β If AZ fails: βββββββββΌββββββ β
β Database is DOWN β Standby β β
β β (AZ-b) β β
β ββββββββ¬ββββββββ β
β β β
β If primary fails: β
β Standby becomes new β
β primary automatically β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Supported Engines
Amazon Aurora: MySQL and PostgreSQL compatible, 5x faster than standard MySQL, 3x faster than PostgreSQL. Automated storage scaling.
MySQL: The world's most popular open-source database. Full AWS management and optimization.
PostgreSQL: Advanced open-source database with strong extensibility and standards compliance.
MariaDB: MySQL-compatible fork with additional features and performance improvements.
Key Features
Automated Backups: Point-in-time recovery up to 35 days. Take snapshots anytime.
Read Replicas: Offload read traffic from the primary instance. Up to 15 replicas with Aurora.
Multi-AZ: Automatic failover to standby in another availability zone.
Performance Insights: Identify database load and optimize slow queries.
Encryption: At rest with KMS, in transit with SSL/TLS.
When to Use RDS vs DynamoDB
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββ
β RDS β DynamoDB β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββ€
β Complex queries/joins β Simple key lookups β
β ACID transactions β Single-digit ms latencyβ
β Schema flexibility: Low β Schema flexibility: Highβ
β Scale: Vertical + reads β Scale: Unlimited β
β Cost: Predictable β Cost: Per request β
ββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββ