Lab 05: AWS RDS Architecture

Time: 50 minutes | Level: Architect | DB: AWS RDS (boto3 simulation)


🎯 Objective

Master AWS RDS architecture: Multi-AZ, Read Replicas, storage options, parameter groups, RDS Proxy, and Aurora. Use boto3 to simulate RDS API calls with realistic configurations and responses.


📚 Background

RDS Architecture Overview

                    ┌─────────────────────────┐
                    │      AWS Region          │
                    │  ┌───────────────────┐   │
 Application        │  │ Availability Zone A│   │
 (EC2/Lambda) ─────►│  │  ┌─────────────┐  │   │
                    │  │  │ RDS Primary │  │   │
                    │  │  │  (read/write)│  │   │
                    │  │  └──────┬──────┘  │   │
                    │  └─────────┼─────────┘   │
                    │            │ sync repl    │
                    │  ┌─────────┼─────────┐   │
                    │  │ Avail Zone B      │   │
                    │  │  ┌──────▼──────┐  │   │
                    │  │  │  Standby    │  │   │
                    │  │  │ (Multi-AZ)  │  │   │
                    │  │  └─────────────┘  │   │
                    │  └───────────────────┘   │
                    │                          │
                    │  Read Replica (async) ◄──┤
                    └─────────────────────────┘

Key RDS Concepts

Feature
Multi-AZ
Read Replica

Replication

Synchronous

Asynchronous

Purpose

HA / failover

Read scaling

Failover time

60-120 seconds

Manual promotion

Readable?

No (standby only)

Yes

Cross-region

No

Yes

Cost

2x instance

1x per replica

Aurora vs RDS

Feature
RDS MySQL/PostgreSQL
Aurora

Storage

EBS per instance

Shared distributed (6 copies, 3 AZs)

Read replicas

5 max

15 max

Failover

60-120s

30s typical

Storage scaling

Manual

Auto up to 128 TB

Write scaling

Single primary

Multi-master (MySQL only)

Cost

Lower

~20% more, but less ops overhead


Step 1: Install boto3

📸 Verified Output:


Step 2: Simulate RDS Instance Creation

📸 Verified Output:


Step 3: Read Replica Creation

📸 Verified Output:


Step 4: Aurora Architecture Deep Dive

📸 Verified Output:


Step 5: RDS Parameter Groups

📸 Verified Output:


Step 6: Storage Options Comparison

📸 Verified Output:


Step 7: Multi-AZ Failover Simulation

📸 Verified Output:


Step 8: Capstone — RDS Cost Calculator

📸 Verified Output:


Summary

Concept
Key Takeaway

Multi-AZ

Synchronous standby in another AZ; 60-120s failover; NOT readable

Read Replica

Async replication; readable; up to 5 (RDS) or 15 (Aurora)

RDS Proxy

Connection pooling + fast failover; required for Lambda

Aurora Storage

6 copies across 3 AZs; shared storage; no replication lag for readers

Aurora Serverless v2

Auto-scales 0.5 to 128 ACU; pay per ACU-hour

gp3 storage

Best default: 3,000 IOPS base + provision more independently

io1/io2 storage

For >16,000 IOPS or sub-1ms latency requirements

Parameter Groups

shared_buffers = 25% RAM; work_mem carefully (per operation)

Reserved Instances

40% savings for 1yr, 60% for 3yr vs on-demand

💡 Architect's insight: Start with RDS Multi-AZ + gp3. Use Aurora when you need >5 read replicas, fast failover, or Serverless auto-scaling. Add RDS Proxy whenever using Lambda or connection-heavy frameworks.

Last updated