AWS RDS vs DynamoDB
- AWS offers both relational (RDS/Aurora) and NoSQL (DynamoDB) managed database services.
- Choosing between them depends on data model, access patterns, scale requirements, and consistency needs.
- Many architectures use both — RDS for transactional data and DynamoDB for high-scale, low-latency access patterns.
RDS vs DynamoDB Comparison
| Feature | Amazon RDS / Aurora | Amazon DynamoDB |
|---|---|---|
| Type | Relational (SQL) | NoSQL (key-value / document) |
| Data Model | Fixed schema, tables with relationships | Flexible schema, single-table design |
| Query Language | SQL (complex joins, aggregations) | PartiQL / API (key-based access, limited filtering) |
| Scaling | Vertical (instance size) + Read Replicas; Aurora Limitless for horizontal | Horizontal (automatic, unlimited); on-demand or provisioned |
| Performance | Depends on instance size; millisecond queries | Single-digit millisecond at any scale; DAX for microsecond |
| Max Storage | RDS: 64 TiB; Aurora: 128 TiB | Unlimited |
| Consistency | ACID transactions, strong consistency | Eventually consistent (default); strong consistent reads available |
| Transactions | Full SQL transactions (multi-table) | TransactWriteItems/TransactGetItems (up to 100 items) |
| Joins | Native SQL JOINs across tables | No joins — denormalize or use application-side logic |
| Indexes | B-tree, hash, GIN, full-text | GSI (up to 20), LSI (up to 5) |
| HA / DR | Multi-AZ (sync replication); Aurora Global Database | Multi-AZ by default; Global Tables (multi-Region active-active) |
| Serverless | Aurora Serverless v2 (scales to zero possible) | On-demand mode (true pay-per-request, scales to zero) |
| Backup | Automated snapshots, PITR (5-min granularity) | Continuous backups, PITR (1-second granularity) |
| Pricing Model | Instance hours + storage + I/O | Read/Write capacity units or per-request |
| Maintenance | Maintenance windows, patching required | Zero maintenance, fully managed |
| Analytics | Native SQL analytics, zero-ETL to Redshift | Zero-ETL to Redshift/OpenSearch; export to S3 |
When to Choose RDS / Aurora
- Complex queries — need SQL JOINs, aggregations, subqueries, window functions.
- ACID transactions — financial systems, order processing, inventory management.
- Existing relational schema — migrating from on-premises MySQL/PostgreSQL/Oracle/SQL Server.
- Reporting workloads — need ad-hoc queries across multiple tables.
- Normalized data model — relationships between entities are primary concern.
- Moderate scale — up to hundreds of thousands of requests/second (Aurora).
- Examples: E-commerce orders, banking, ERP, CMS with complex relationships.
When to Choose DynamoDB
- Known access patterns — you can design a key schema around how data is queried.
- Massive scale — millions of requests/second with consistent single-digit millisecond latency.
- Simple key-value or document lookups — get/put by primary key.
- Serverless / event-driven architectures — pairs naturally with Lambda.
- Global applications — multi-Region active-active with Global Tables.
- Variable/spiky traffic — on-demand mode handles any traffic without pre-provisioning.
- Zero operational overhead — no patching, no maintenance windows.
- Examples: Gaming leaderboards, session stores, IoT data, shopping carts, user profiles.
Using Both Together
- Common pattern: RDS for source of truth (transactions) + DynamoDB for read-heavy access (caching, APIs).
- Use DynamoDB Streams + Lambda to sync DynamoDB changes to RDS (or vice versa).
- Use zero-ETL from Aurora/DynamoDB to Redshift for unified analytics.
- Example: E-commerce — RDS for order processing, DynamoDB for product catalog and session data.
AWS Certification Exam Practice Questions
- A social media application needs to store user profiles and serve them with single-digit millisecond latency at millions of requests per second globally. Which database is most appropriate?
- Aurora PostgreSQL with read replicas
- DynamoDB with Global Tables
- RDS MySQL Multi-AZ
- ElastiCache Redis
- A financial application requires complex multi-table transactions where a transfer must debit one account and credit another atomically, with full SQL reporting capabilities. Which is most appropriate?
- DynamoDB with TransactWriteItems
- Aurora PostgreSQL with Multi-AZ
- DynamoDB with DAX
- Aurora Serverless with DynamoDB Streams
- A startup wants to minimize operational overhead with zero maintenance, pay only for actual usage, and handle unpredictable traffic spikes from 0 to 100K requests/second. Which option is best?
- Aurora Serverless v2
- DynamoDB On-Demand mode
- RDS with Auto Scaling read replicas
- Aurora with Provisioned capacity
- An analytics team needs to run complex ad-hoc SQL queries with JOINs across customer, order, and product tables without knowing access patterns in advance. Which is appropriate?
- DynamoDB with GSIs
- DynamoDB with PartiQL
- Aurora PostgreSQL
- DynamoDB export to S3 + Athena
- A gaming company stores player sessions in DynamoDB and order history in Aurora. They want unified analytics across both datasets without ETL pipelines. Which feature enables this?
- DynamoDB Streams to Aurora via Lambda
- Zero-ETL from both Aurora and DynamoDB to Redshift
- DynamoDB export to S3 + Aurora export to S3
- Federated queries in Athena
Related Posts
- AWS DynamoDB
- AWS RDS Aurora
- AWS Aurora vs RDS
- AWS DynamoDB vs DocumentDB vs Neptune
- AWS Database Services Cheat Sheet