Amazon RDS (Relational Database Service)

Amazon RDS is a managed relational database service that provisions, patches, backs up, and replicates databases across multiple engines: PostgreSQL, MySQL, MariaDB, Oracle, Microsoft SQL Server, IBM Db2, and Amazon Aurora (covered separately). RDS removes the operational toil of running a database server while keeping the engine itself standard, so existing applications and tooling work unchanged.


Key Features:


Common Use Cases:


Service Limits & Quotas:


Pricing Model:


Code Example — Create a Multi-AZ PostgreSQL Instance:


aws rds create-db-instance \
  --db-instance-identifier prod-orders \
  --db-instance-class db.r6g.xlarge \
  --engine postgres \
  --engine-version 16.3 \
  --allocated-storage 200 \
  --storage-type gp3 \
  --multi-az \
  --master-username dbadmin \
  --manage-master-user-password \
  --master-user-secret-kms-key-id alias/rds-secrets \
  --vpc-security-group-ids sg-0abc123 \
  --db-subnet-group-name prod-private \
  --backup-retention-period 14 \
  --storage-encrypted \
  --kms-key-id alias/rds \
  --enable-performance-insights \
  --performance-insights-retention-period 731 \
  --deletion-protection
  

Connect via boto3 + IAM Auth:


import boto3, psycopg2

rds = boto3.client("rds", region_name="us-west-2")
token = rds.generate_db_auth_token(
    DBHostname="prod-orders.abc123.us-west-2.rds.amazonaws.com",
    Port=5432,
    DBUsername="app_role",
)

conn = psycopg2.connect(
    host="prod-orders.abc123.us-west-2.rds.amazonaws.com",
    port=5432,
    user="app_role",
    password=token,
    dbname="orders",
    sslmode="require",
)
  


Common Interview Questions:

Multi-AZ vs. read replica — what's the difference?

Multi-AZ is for HA: the standby is synchronous, not readable, and exists only to fail over on AZ outage or instance failure (60-120s RTO). A read replica is async, readable, and used for read scaling or DR — promoting one to standalone is a manual recovery action, not automatic failover.

When use RDS Proxy?

For Lambda or other ephemeral compute that opens connections per invocation, for failover-aware connection pooling that survives instance failover with sub-second reconnect, and for IAM-only authentication without distributing passwords. Adds ~$0.015/hr per vCPU.

How does point-in-time recovery work?

Daily automated full backup plus continuous transaction log archive to S3 enables restoring to any second within the retention window. Restore creates a new instance — you can't restore in place.

What's a Blue/Green Deployment?

RDS provisions a green copy of the database (with replicas), keeps it in sync via logical replication, lets you upgrade the engine or modify parameters there, then performs a coordinated switchover by renaming endpoints. Downtime is typically under a minute and the blue (old) environment is preserved for rollback.

How do you encrypt an unencrypted RDS instance?

You can't encrypt in place. Snapshot the unencrypted instance, copy the snapshot with encryption enabled and a KMS key, then restore the encrypted snapshot to a new instance. Switch the application to the new endpoint.

RDS vs. Aurora — when pick which?

RDS for vanilla MySQL/Postgres/Oracle/SQL Server workloads or when you need a specific engine version Aurora doesn't yet support. Aurora when you need higher throughput, more replicas, faster failover, Serverless v2 elasticity, or Aurora-specific features like Global Database and Backtrack.


RDS is the default managed relational database for AWS — pick the right engine, enable Multi-AZ for production, encrypt with KMS, manage credentials in Secrets Manager, and reserve instances for predictable workloads.