AWS RDS
Amazon RDS (Relational Database Service) runs managed relational databases — PostgreSQL, MySQL, MariaDB, SQL Server, Oracle — so you keep familiar SQL while AWS handles the operational toil: provisioning, backups, patching, monitoring, and failover.
For most teams, RDS beats self-hosting a database on a VM. You trade some low-level control for automated durability and high availability, which is almost always the right call unless you have a specific reason to manage the engine yourself.
TL;DR
- Managed relational databases — less ops, familiar SQL.
- Plan Multi-AZ (high availability) and read replicas from the start.
- Pool connections, especially from serverless clients.
- Prefer RDS over self-hosting on EC2 unless you have a strong reason.
Quick Example
Provisioning a Multi-AZ Postgres instance is a single CLI call — AWS handles failover, backups, and patching:
Core Concepts
- Managed engine — Postgres, MySQL, etc., with automated backups, snapshots, and patching windows.
- Multi-AZ — a synchronous standby in another availability zone for automatic failover.
- Read replicas — offload read traffic (engine-dependent).
- Aurora — AWS's cloud-native, higher-performance MySQL/Postgres-compatible option in the same family.
Best Practices
- Keep the database in private subnets; never expose it to the public internet.
- Use least-privilege database users; enable encryption and enforce TLS.
- Turn on Multi-AZ for production HA, and test restores (not just backups).
- Pool connections (e.g. RDS Proxy / PgBouncer) for serverless and high-concurrency apps.
- Monitor slow queries and add indexes; right-size storage and IOPS.
Scaling
See Caching and Database Replication.
Common Mistakes
Connection exhaustion from serverless
Skipping Multi-AZ
FAQ
RDS or self-hosting a database on EC2?
RDS for almost everyone — it automates backups, patching, monitoring, and failover, which are easy to get wrong by hand. Self-host on EC2 only when you need OS/engine-level control or a configuration RDS doesn't support, and you have the expertise to operate it.
What is Multi-AZ and do I need it?
Multi-AZ maintains a synchronous standby replica in another availability zone and fails over to it automatically if the primary fails. For production, yes — it's the main mechanism for high availability and zero-data-loss failover within a region.
RDS or Aurora?
RDS runs the standard engines (community Postgres/MySQL, etc.). Aurora is AWS's cloud-native, MySQL/Postgres-compatible engine with higher performance, faster failover, and storage that scales automatically — at a different price point. Choose Aurora for demanding workloads, RDS for standard ones.
How do I handle too many connections?
Use RDS Proxy or an application-side pooler. Relational databases (especially Postgres) allocate resources per connection, so large fleets of serverless functions can exhaust the limit. A pooler multiplexes many clients onto few backend connections.
Related Topics
- PostgreSQL — A common RDS engine
- Google Cloud SQL — The GCP equivalent
- Cloud Computing — Managed services overview
- Database Replication — Read replicas and HA
- Caching — Reducing database load