Skip to content

RDS

Amazon Relational Database Service (Amazon RDS) is a managed database service that simplifies the process of setting up, operating, and scaling relational databases in the cloud. By handling time-consuming administrative tasks like hardware provisioning, patching, backups, and failure detection, RDS enables you to focus on your applications rather than database management.

This comprehensive guide covers everything you need to know about Amazon RDS, from core concepts to hands-on implementation and advanced features.


Amazon RDS is a web service that makes it easier to set up, operate, and scale a relational database in the cloud. It provides cost-efficient, resizable capacity for industry-standard relational databases and manages common database administration tasks.

BenefitDescription
Fully ManagedAWS handles hardware provisioning, software patching, backups, and failure detection
Easy to UseLaunch a production-ready database in minutes using the console, CLI, or API
ScalableScale compute and storage resources with push-button operations and zero downtime
Highly AvailableMulti-AZ deployments with automatic failover for mission-critical workloads
SecureEncryption at rest and in transit, network isolation with VPC, and IAM integration
Cost-EffectivePay only for the resources you use with no upfront investments

Amazon RDS supports seven popular database engines, allowing you to use the code, applications, and tools you already use today.

Database EngineBest For
Amazon AuroraHigh-performance, MySQL/PostgreSQL-compatible, enterprise-grade applications
MySQLWeb applications, open-source stacks, cost-effective solutions
PostgreSQLAdvanced geospatial and JSON support, complex queries
MariaDBMySQL drop-in replacement with additional storage engines
Microsoft SQL Server.NET applications, Windows ecosystem integration
OracleEnterprise applications, existing Oracle licenses
IBM Db2Large enterprise workloads requiring Db2 compatibility

Note: Amazon Aurora is AWS’s cloud-native relational database, offering up to 5x the throughput of standard MySQL and 3x that of standard PostgreSQL.


The following diagram illustrates the key components of an RDS deployment:

Application → Security Group → RDS DB Instance (Multi-AZ optional) → Storage (EBS)
Read Replicas (optional)
ComponentDescription
DB InstanceAn isolated database environment running in the cloud; the basic building block of RDS
DB Instance ClassDetermines the compute and memory capacity of your database instance
DB Subnet GroupDefines which subnets and Availability Zones your database can use
Security GroupActs as a virtual firewall controlling inbound and outbound traffic
Parameter GroupContains engine-specific configuration parameters for your database
Option GroupContains optional features for your database engine (e.g., Oracle Enterprise Manager)

For databases that require operating system access, RDS Custom provides managed access to the underlying EC2 instances. Currently available for Oracle and Microsoft SQL Server. Unlike standard RDS where you cannot SSH into instances, RDS Custom grants you this level of control.


4. Step-by-Step: Creating Your First RDS Database

Section titled “4. Step-by-Step: Creating Your First RDS Database”
  • An AWS account
  • AWS Management Console access

Method 1: Using the AWS Console (Easy Create)

Section titled “Method 1: Using the AWS Console (Easy Create)”

The “Easy create” option simplifies database provisioning by automatically configuring settings such as instance class, storage type, and networking.

Step-by-Step Instructions:

  1. Sign in to AWS Console and navigate to RDS at https://console.aws.amazon.com/rds/

  2. Choose Create database

  3. Select creation method - Choose Easy create

  4. Choose Engine type - For this tutorial, select MySQL

  5. Select DB instance size - Choose Free tier (for free plan accounts) or Sandbox (for paid plan accounts)

  6. Configure database settings:

    • DB instance identifier: Enter a name (or keep the generated name)
    • Credentials management: Select Self-managed
    • Master password: Enter and confirm a password
  7. Review default settings - Expand “View default settings for Easy create” to see what RDS configures automatically

  8. Click Create database

The database appears in the Databases list with a status of Creating. When the status changes to Available, your DB instance is ready to use.

For programmatic creation, use the AWS CLI. First, install and configure the AWS CLI, then run:

Terminal window
aws rds create-db-instance \
--db-instance-identifier my-db-instance \
--db-instance-class db.t4g.micro \
--engine mysql \
--master-username my-username \
--master-user-password my-password \
--allocated-storage 20 \
--no-publicly-accessible \
--backup-retention-period 7 \
--storage-type gp2 \
--engine-version 8.0.39

Important Configuration Settings for Production

Section titled “Important Configuration Settings for Production”

When using the Standard create workflow for production databases, consider these settings carefully:

SettingConsiderations
Storage allocationGeneral Purpose SSD for balance; Provisioned IOPS for high-performance transactional apps
Instance classStandard for general workloads; Memory-optimized for high memory needs; Burstable for intermittent workloads
Public accessEnable for external access (with security group restrictions); Disable for internal apps or enhanced security
Multi-AZ deploymentEnable for production workloads requiring high availability
Backup retentionConfigure 7-35 days based on recovery requirements

Amazon RDS offers multiple storage types optimized for different workloads.

Storage TypeDescriptionBest ForIOPS
General Purpose (gp2/gp3)SSD-backed storage with baseline performance and bursting capabilityBroad range of workloads, development/test environments3 IOPS/GB baseline, burst up to 3000 IOPS
Provisioned IOPS (io1/io2)SSD-backed storage with consistent, predictable I/O performanceI/O-intensive transactional (OLTP) workloadsUp to 256,000 IOPS
Magnetic (standard)Previous generation storageNot recommended for new workloads

RDS can automatically scale storage when free space runs low. To enable:

  1. Set a Maximum Storage Threshold
  2. RDS auto-detects when storage is running out
  3. Storage increases automatically without downtime
Database EngineMaximum Storage
Amazon Aurora64 TB (auto-scaling)
MySQL, MariaDB, PostgreSQL, Oracle64 TB
Microsoft SQL Server16 TB
FeatureBenefitAvailability
Optimized WritesImproves write transaction throughput by up to 2xRDS for MySQL (Nitro System)
Optimized ReadsUp to 2x faster query processing for complex queries using temporary tablesRDS for MySQL and MariaDB

6. High Availability with Multi-AZ Deployments

Section titled “6. High Availability with Multi-AZ Deployments”

Multi-AZ deployments provide enhanced availability and durability for production database workloads by synchronously replicating data to a standby instance in a different Availability Zone (AZ).

Primary AZ Standby AZ
┌─────────────────┐ ┌─────────────────┐
│ Primary DB │ Synchronous │ Standby DB │
│ Instance │ ←───────────── │ Instance │
│ (Active) │ Replication │ (Passive) │
└─────────────────┘ └─────────────────┘
│ │
└─────────── Automatic Failover ────┘
FeatureDescription
Synchronous replicationData is copied to standby before commit confirms
Automatic failoverRDS automatically promotes standby if primary fails
Same connection stringNo application changes needed after failover
No downtime for conversionModify Single-AZ to Multi-AZ without downtime

Using Console:

  • During creation: Select “Multi-AZ deployment”
  • For existing instances: Modify instance and enable Multi-AZ

Using AWS CLI:

Terminal window
aws rds modify-db-instance \
--db-instance-identifier my-db-instance \
--multi-az
Use CaseRecommendation
Production workloadsAlways use Multi-AZ
Development/TestSingle-AZ is sufficient
Financial applicationsMulti-AZ with Provisioned IOPS
Disaster recovery requirementsMulti-AZ + cross-region read replicas

Read Replicas allow you to scale out beyond the capacity constraints of a single DB instance for read-heavy database workloads.

┌─────────────────┐
│ Primary DB │
│ (Writes) │
└────────┬────────┘
│ Asynchronous
│ Replication
┌──────────────┼──────────────┐
↓ ↓ ↓
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Read │ │ Read │ │ Read │
│ Replica 1 │ │ Replica 2 │ │ Replica 3 │
│ (Read-only) │ │ (Read-only) │ │ (Read-only) │
└─────────────┘ └─────────────┘ └─────────────┘
FeatureDescription
Asynchronous replicationMinimal performance impact on primary
Up to 15 replicasMaximum number per primary instance
Unique connection stringEach replica has its own endpoint
Cross-region supportCreate replicas in different AWS regions
Promotion capabilityCan promote a replica to a standalone primary

Using AWS CLI:

Terminal window
aws rds create-db-instance-read-replica \
--db-instance-identifier my-read-replica \
--source-db-instance-identifier my-db-instance
Use CaseDescription
Read-heavy applicationsOffload SELECT queries to replicas
Reporting and analyticsRun complex queries without impacting production
Global usersPlace replicas closer to users (cross-region)
Disaster recoveryCross-region replicas for failover capabilities

For production environments, use ProxySQL or similar tools to route queries based on SQL read/write patterns:

INSERT INTO mysql_servers (hostgroup_id, hostname, port)
VALUES (1, 'replica1.endpoint', 3306);

RDS Proxy is a fully-managed, highly available database proxy that enables applications to improve scalability, availability, and security.

BenefitDescription
Connection poolingMultiple application connections share database connections
Reduced failover timeReduces failover times by up to 66%
Connection preservationPreserves application connections during failovers
IAM authenticationEnforce IAM-based authentication to databases
Secrets Manager integrationSecurely store database credentials
Use CaseWhy RDS Proxy Helps
Serverless applicationsLambda functions can pool connections efficiently
Unpredictable workloadsGracefully handles connection bursts
Frequent connection opens/closesPHP, Ruby on Rails applications
Idle connectionsHolds idle connections without database overhead
OptionDescription
Secrets ManagerStore credentials centrally; same username/password workflow
IAM authentication (client → proxy)Use IAM execution roles; Secrets Manager for proxy→database
Full IAM authenticationNo database passwords stored anywhere

RDS Proxy is available for:

  • Amazon Aurora (MySQL and PostgreSQL compatibility)
  • Amazon RDS for MariaDB
  • Amazon RDS for MySQL
  • Amazon RDS for PostgreSQL
  • Amazon RDS for SQL Server

Automated backups enable point-in-time recovery (PITR) for your database instance.

FeatureDescription
Daily backupFull backup of your database
Transaction log backupEvery 5 minutes
Retention periodConfigurable up to 35 days
Point-in-time recoveryRestore to any second within retention period
Storage locationStored in S3
Terminal window
aws rds modify-db-instance \
--db-instance-identifier my-db-instance \
--backup-retention-period 7

User-initiated backups stored in S3 that persist until explicitly deleted.

FeatureDescription
User-initiatedTake snapshots manually as needed
PersistentRemain until explicitly deleted
RestorationCreate new instance from snapshot at any time
No retention limitKeep as long as needed
FeatureAutomated BackupsManual Snapshots
InitiationAutomatic (daily)Manual
Retention limitUp to 35 daysNo limit
Point-in-time recoveryYesNo (single point)
DeletionAutomatic after retention periodManual only
MethodDescription
Point-in-time restoreRestore to any second within retention period
Snapshot restoreCreate new instance from manual snapshot
Cross-region snapshot copyCopy snapshots to other regions for DR

RDS encrypts databases using keys managed through AWS Key Management Service (KMS).

FeatureDescription
Encryption methodAES-256 encryption algorithm
Encrypted componentsUnderlying storage, automated backups, read replicas, snapshots
Key managementAWS KMS (customer-managed or AWS-managed keys)
Transparent Data Encryption (TDE)Supported for SQL Server and Oracle

Important: Encryption must be enabled at instance creation time—you cannot encrypt an existing unencrypted instance.

RDS supports SSL/TLS to secure data in transit.

-- For MySQL, connect with SSL:
mysql -h mydb.123456789012.us-east-1.rds.amazonaws.com
--ssl-ca=path/to/rds-ca-2019-root.pem
-u myuser -p
FeatureDescription
VPC deploymentRun database instances in your own virtual network
Security GroupsControl what IP addresses or EC2 instances can connect
Private subnetsKeep databases internal, not exposed to internet
VPN connectivityConnect to on-premises infrastructure with encrypted IPsec VPNs
MethodDescription
IAM authenticationUse IAM roles to connect to database (instead of username/password)
Resource-level permissionsControl actions on specific RDS resources by IAM users/groups
Tag-based accessControl access based on resource tags (e.g., “Development” vs “Production”)
Terminal window
aws rds modify-db-instance \
--db-instance-identifier my-db-instance \
--enable-iam-database-authentication

RDS is eligible for:

  • PCI DSS
  • SOC
  • HIPAA (with executed BAA)
  • FedRAMP
  • FIPS 140-2

11. Monitoring and Performance Optimization

Section titled “11. Monitoring and Performance Optimization”
ToolPurpose
CloudWatchKey operational metrics: CPU, memory, storage, I/O, connections
Enhanced MonitoringDetailed OS-level metrics: CPU, memory, file system, disk I/O
Performance InsightsDetect performance problems, identify slow queries
Event NotificationsEmail/SMS alerts via SNS for database events
AWS ConfigTrack configuration changes for compliance
MetricDescriptionAlarm Threshold
CPUUtilizationPercentage of CPU usage> 80%
DatabaseConnectionsNumber of database connections> 80% of max
FreeStorageSpaceAvailable storage space< 10%
ReadLatencyTime for read operations> 100ms
ReplicaLagTime replica is behind primary (for read replicas)> 60 seconds
StrategyDescription
Right-size instance classMonitor utilization and adjust instance size
Enable Optimized Reads/WritesFor up to 2x better performance
Use read replicasOffload read queries
Implement cachingUse ElastiCache for Redis to cache frequent queries
Optimize queriesUse Performance Insights to identify slow queries
import redis
import pymysql
cache = redis.StrictRedis(host='redis-cluster-endpoint', port=6379)
def get_data(query_key, sql_query):
data = cache.get(query_key)
if not data:
# Cache miss - query database
connection = pymysql.connect(host='db-endpoint', ...)
cursor = connection.cursor()
cursor.execute(sql_query)
data = cursor.fetchall()
cache.set(query_key, data, ex=3600) # Cache for 1 hour
return data

Blue/Green Deployments create a staging environment that mirrors the production environment and keeps both environments in sync using logical replication.

FeatureDescription
Safe updatesMake changes without impacting production workload
Use casesMajor/minor version upgrades, schema modifications, parameter changes
SynchronizationLogical replication keeps environments in sync
GuardrailsTimeouts, replication error detection, health checks
Supported enginesAurora MySQL, RDS for MySQL, RDS for MariaDB
┌─────────────┐ ┌─────────────┐
│ Blue │ Logical │ Green │
│ (Production)│ ──────→ │ (Staging) │
└─────────────┘ Replica └─────────────┘
Make changes here
Promote when ready

RDS pricing includes three main components:

ComponentDescription
Compute (Instance hours)Based on DB instance class
StoragePer GB-month for provisioned storage
I/O requestsFor magnetic storage only (SSD includes I/O)

New AWS customers receive:

  • 750 hours/month of db.t2.micro or db.t3.micro for 12 months
  • 20 GB of General Purpose SSD storage
  • 20 GB of backup storage
StrategyDescription
Right-size instancesUse AWS Compute Optimizer for recommendations
Use reserved instancesUp to 60% savings for 1-3 year commitments
Leverage read replicasOffload reads without upgrading primary
Delete unused snapshotsOld manual snapshots incur storage costs
Optimize backup retentionReduce retention period for non-production
Use Graviton instancesBetter price-performance for supported engines

PracticeDescription
Use Multi-AZ for productionEnsures high availability and automatic failover
Enable automated backupsSet retention period based on recovery needs
Deploy read replicasScale read-heavy workloads
Use RDS ProxyFor connection pooling and failover resilience
PracticeDescription
Enable encryption at restConfigure at creation time; cannot be added later
Enforce SSL/TLSRequire encrypted connections for all clients
Run in private subnetsDisable public access for production databases
Use IAM authenticationAvoid hardcoded credentials in applications
Store credentials in Secrets ManagerCentralize and rotate secrets automatically
Apply least privilegeGrant minimum necessary permissions
PracticeDescription
Monitor with CloudWatchSet alarms for critical metrics
Test restore proceduresRegularly validate backup integrity
Use Performance InsightsIdentify and optimize slow queries
Implement maintenance windowsSchedule updates during low-traffic periods
Tag resourcesTrack costs and manage environments effectively
PracticeDescription
Choose appropriate instance classMatch workload requirements
Enable Optimized Reads/WritesFor MySQL and MariaDB workloads
Use Provisioned IOPSFor I/O-intensive workloads
Implement cachingUse ElastiCache for frequent queries
Regularly optimize queriesUse Performance Insights to identify issues

This glossary includes key terms directly related to Amazon RDS.


Automated Backup Automatic backup feature enabling point-in-time recovery. RDS backs up the database daily and transaction logs every 5 minutes, storing both for a user-specified retention period (up to 35 days).

Aurora AWS cloud-native relational database compatible with MySQL and PostgreSQL. Offers up to 5x the throughput of standard MySQL and 3x of standard PostgreSQL with a distributed storage architecture.

Availability Zone (AZ) Distinct physical location within an AWS Region engineered to be isolated from failures in other AZs. Multi-AZ deployments place a standby instance in a different AZ for high availability.


Blue/Green Deployment Database update method creating a staging environment (green) that mirrors production (blue) using logical replication. Enables safer major/minor version upgrades, schema modifications, and parameter changes without impacting production.


CloudWatch AWS monitoring service providing key operational metrics for RDS instances, including CPU utilization, memory, storage I/O, and database connections.

Connection Pooling Technique where multiple application connections share a database connection. RDS Proxy implements connection pooling to reduce database overhead and improve scalability.


Database Engine Relational database software powering an RDS instance. Supported engines include Aurora, MySQL, PostgreSQL, MariaDB, Oracle, Microsoft SQL Server, and Db2.

DB Instance Isolated database environment running in the cloud; the basic building block of Amazon RDS.

DB Instance Class Determines the compute and memory capacity allocated to a DB instance. Options include Standard (general-purpose), Memory-Optimized (high memory needs), and Burstable (intermittent workloads).

DB Parameter Group Container for engine-specific configuration parameters that control database behavior. Allows granular control and fine-tuning of your database.

DB Subnet Group Collection of subnets (typically private) that you designate for your RDS database. Defines which Availability Zones your database can use.


Enhanced Monitoring RDS feature providing access to OS-level metrics including CPU, memory, file system, and disk I/O statistics.


Failover Automatic process where RDS promotes a standby Multi-AZ instance to primary when the original primary fails. Designed to minimize downtime.

Free Tier AWS program offering 750 hours/month of select RDS instances (db.t2.micro or db.t3.micro) for 12 months for new customers.


General Purpose SSD (gp2/gp3) SSD-backed storage type delivering baseline of 3 IOPS per provisioned GB with burst capability. Suitable for broad range of database workloads.


IAM Authentication Authentication method using IAM roles to connect to RDS databases instead of traditional username/password. Can be enforced with RDS Proxy for enhanced security.


KMS (Key Management Service) AWS service for creating and managing encryption keys. RDS uses KMS keys to encrypt data at rest, including underlying storage, automated backups, read replicas, and snapshots.


Maintenance Window Weekly time period (30 minutes) when RDS applies patches and updates. You can customize the day and time for your maintenance window.

Multi-AZ Deployment High availability feature synchronously replicating data to a standby instance in a different Availability Zone. Provides automatic failover and enhanced durability for production workloads.


Optimized Reads RDS feature improving complex query processing speed for MySQL and MariaDB. Places temporary tables on NVMe-based instance storage, accelerating sorts, hash aggregations, high-load joins, and CTEs by up to 2x.

Optimized Writes RDS feature improving write transaction throughput for MySQL on the Nitro System. Writes 16KiB data pages in a single step, improving throughput by up to 2x.

Option Group Container for optional engine-specific features. For Oracle, can include native network encryption or Enterprise Manager.


Performance Insights RDS monitoring tool that helps detect performance problems by identifying slow queries and visualizing database load.

Point-in-Time Recovery (PITR) Restore capability allowing you to recover a database to any second within your backup retention period (up to 35 days).

Provisioned IOPS (io1/io2) SSD-backed storage type delivering fast, predictable, consistent I/O performance. Optimized for I/O-intensive transactional (OLTP) workloads.


RDS Custom RDS variant providing managed access to underlying EC2 instances. Available for Oracle and SQL Server when OS access is required.

RDS Proxy Fully-managed, highly available database proxy providing connection pooling, reduced failover times (up to 66%), and IAM authentication enforcement.

Read Replica Asynchronous copy of a primary database used for read-heavy workloads. You can create up to 15 read replicas per primary instance.


Security Group Virtual firewall controlling inbound and outbound traffic to RDS instances. Security groups are stateful and support allow rules only.

Snapshot User-initiated backup of a DB instance stored in Amazon S3. Remains until explicitly deleted. Can be used to create new DB instances.

Synchronous Replication Replication method where data is written to both primary and standby instances before commit confirms. Used in Multi-AZ deployments for zero data loss.


Transparent Data Encryption (TDE) Encryption feature for SQL Server and Oracle where database server automatically encrypts data before writing to storage and decrypts when reading. Oracle TDE integrates with AWS CloudHSM.


VPC (Virtual Private Cloud) Logically isolated section of AWS cloud where RDS databases are launched. Provides network-level isolation and security.


Amazon RDS fundamentally changes how teams manage relational databases in the cloud by automating time-consuming administrative tasks. With its managed service model, multiple engine choices, and enterprise-grade features, RDS enables teams to focus on application development rather than database administration.

Key Takeaways:

  • Fully managed service - AWS handles provisioning, patching, backups, and failure detection
  • Seven database engines - Choose from Aurora, MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, or Db2
  • Multi-AZ for high availability - Synchronous replication with automatic failover for production workloads
  • Read Replicas for scaling - Up to 15 replicas for read-heavy workloads
  • RDS Proxy for connection management - Pool connections, reduce failover times, enhance security
  • Encryption everywhere - At rest (KMS/TDE) and in transit (SSL/TLS)
  • Blue/Green Deployments - Safe database updates with staging environments

Getting Started Recommendations:

  • Start with the Free Tier using Easy Create for MySQL or PostgreSQL
  • Enable automated backups with appropriate retention period
  • Use Multi-AZ for any production workload
  • Implement RDS Proxy for serverless or connection-intensive applications
  • Set up CloudWatch alarms for critical metrics