Databases

RDS — Managed Databases

Set up and manage relational databases in the cloud with Amazon RDS.

Amazon RDS

Relational Database Service (RDS) makes it easy to set up, operate, and scale relational databases in the cloud. RDS handles routine database tasks:

  • Provisioning, backups, patching, failure detection, recovery

Supported Engines

  • PostgreSQL
  • MySQL / MariaDB
  • Microsoft SQL Server
  • Oracle
  • Amazon Aurora (MySQL/PostgreSQL compatible, serverless option)

Aurora

Amazon Aurora is a MySQL and PostgreSQL-compatible database with up to 5x the throughput of standard MySQL and 3x of PostgreSQL, at 1/10th the cost of commercial databases.

Key Features

  • Multi-AZ: Automatic failover to standby replica
  • Read replicas: Scale read workloads
  • Automated backups: Point-in-time recovery
  • Encryption: At rest and in transit

Example

bash
# Create an RDS PostgreSQL instance
aws rds create-db-instance   --db-instance-identifier my-postgres   --db-instance-class db.t3.micro   --engine postgres   --engine-version 16   --master-username admin   --master-user-password SecurePassword123!   --allocated-storage 20   --backup-retention-period 7   --multi-az   --no-publicly-accessible   --db-subnet-group-name my-subnet-group   --vpc-security-group-ids sg-12345678

# Describe instances
aws rds describe-db-instances   --db-instance-identifier my-postgres

# Create a read replica
aws rds create-db-instance-read-replica   --db-instance-identifier my-postgres-replica   --source-db-instance-identifier my-postgres

# Create a snapshot
aws rds create-db-snapshot   --db-instance-identifier my-postgres   --db-snapshot-identifier my-postgres-snapshot-2024

# Restore from snapshot
aws rds restore-db-instance-from-db-snapshot   --db-instance-identifier my-postgres-restored   --db-snapshot-identifier my-postgres-snapshot-2024

# Connecting to RDS with psql
psql -h my-postgres.xxxx.us-east-1.rds.amazonaws.com      -U admin      -d mydb
Try it yourself — BASH