AWS Builder Center

AWS Databases Explained: RDS vs DynamoDB & When to Use Each

Explore AWS database options, key differences, pricing, security, and real-world use cases. Learn how to choose the right database for your cloud applications.

Series: Skill Builder Digital Classroom - AWS Cloud Technical Essentials (11 articles)

  1. …
  2. 7
    AWS Databases Explained: RDS vs DynamoDB & When to Use Each This article

AWS Databases Explained: Why Choosing the Right Database Matters More Than Ever

Amazon RDS vs DynamoDB, Purpose-Built Databases, High Availability, Security, and AWS Implementation


Introduction: Your Application Is Only as Reliable as Its Database

A fast application can impress users. A reliable database keeps them coming back. Behind every online purchase, employee record, financial transaction, and customer interaction is a database doing the quiet work of storing, retrieving, and protecting information.
Imagine building an Employee Directory application on AWS. Employees can add their profiles, update job titles, select badges, and upload photographs. Amazon EC2 runs the application, and Amazon S3 stores uploaded images. But something is missing: a database that remembers employee information between sessions.
Your first instinct might be Amazon Relational Database Service (Amazon RDS). It's familiar, supports SQL, and offers managed infrastructure. But what if that familiar choice creates unnecessary costs and operational complexity? What if another database fits the application better?
The smartest database decision isn't about choosing the most powerful technology. It's about choosing the technology that solves your actual problem.






Lesson 1: Understanding Databases on AWS

Why Relational Databases Became the Default

For decades, relational databases were the foundation of enterprise computing. Organizations needed reliable ways to organize customers, transactions, inventory, and financial records. Relational database management systems became popular because they offered structured data, powerful queries, and transactional consistency.
A relational database organizes information into tables containing rows and columns. A row represents a record, and each column represents an attribute. Relationships between tables connect related records. For example, an online bookstore might maintain separate Authors, Books, and Sales tables. Instead of repeating author information across every sale, the application connects records using identifiers.




SQL: The Language That Makes Relationships Useful

Structured Query Language, or SQL, allows applications to interact with relational databases.
A simple query can retrieve every record from a table:

SELECT * FROM Employees;

But SQL becomes particularly useful when data is spread across multiple related tables.
Imagine a company wants to identify which authors generate the most revenue. SQL joins allow it to combine author, book, and sales information without storing everything in one giant table.
Relational databases also support ACID transactions:
  • Atomicity: A transaction succeeds completely or rolls back.
  • Consistency: Transactions preserve defined database rules.
  • Isolation: Concurrent transactions are handled according to the configured isolation level.
  • Durability: Committed changes remain persistent despite failures.
These properties are valuable in banking, commerce, customer relationship management, and enterprise resource planning.

The Trade-Off: Structure Brings Responsibility

Relational databases typically define tables, data types, relationships, and constraints before storing records. Their schemas can evolve, but changes require planning, especially in production systems with large amounts of data.
They also need operational attention.
Someone must manage infrastructure, patch software, configure backups, monitor performance, and protect sensitive information.
That creates an important question:
Should your engineering team spend more time operating a database or building the application that depends on it?
This is where managed database services enter the picture.



Lesson 2: Amazon RDS Less Infrastructure, More Application Focus

What Is Amazon RDS?

Amazon RDS is a managed relational database service that simplifies database provisioning, operation, maintenance, and scaling.
Instead of installing database software on an Amazon EC2 instance and managing the underlying database server yourself, you configure a managed database environment through AWS.
AWS handles infrastructure provisioning, much of the operating-system and database maintenance process, managed backups, and supported high-availability mechanisms. Your team remains responsible for database design, application queries, performance optimization, access controls, and appropriate configuration.



Which Database Engines Does RDS Support?

Amazon RDS supports several established relational database engines:
  • MySQL
  • PostgreSQL
  • MariaDB
  • Oracle Database
  • Microsoft SQL Server
  • IBM Db2
Amazon Aurora is another important AWS managed relational database offering, with MySQL-compatible and PostgreSQL-compatible editions.
Aurora uses a cloud-designed storage architecture that automatically maintains six copies of data across three Availability Zones. AWS positions it for workloads requiring strong availability, scalability, and performance. However, Aurora isn't automatically the best or cheapest option for every application.
Choose the database engine based on application compatibility, workload requirements, operational complexity, and total cost not performance marketing alone.

Understanding RDS Compute and Storage

A standard RDS DB instance provides managed compute resources such as CPU and memory. Its instance class determines the processing capabilities available to the database engine.
For conventional RDS DB instances, database storage generally uses Amazon EBS-backed storage options, including General Purpose SSD and Provisioned IOPS SSD. Aurora uses a different distributed cluster-storage architecture.
A development environment might work well with a smaller burstable instance. A production database processing large transaction volumes may benefit from memory-optimized compute and carefully selected storage performance.
The goal is to match resources to actual demand, not pay for capacity that never gets used.

High Availability: What Happens When a Database Fails?

A database can be perfectly designed and still experience infrastructure failures. Hardware issues, networking problems, and Availability Zone disruptions are realities that production systems must handle.
Amazon RDS provides Multi-AZ deployment options. In a traditional Multi-AZ DB instance deployment, AWS maintains a primary database in one Availability Zone and a synchronous standby in another. If the primary fails, RDS can promote the standby and redirect the database endpoint. Applications must still handle temporary connection interruptions and DNS updates.


There is an important modern distinction: RDS also offers Multi-AZ DB cluster deployments for supported engines and configurations. These use a writer and two readable reader instances across three Availability Zones, allowing read scaling alongside high availability.
The traditional standby instance does not serve normal application read traffic. A Multi-AZ DB cluster's reader instances can.
High availability reduces service disruption. It does not eliminate the need for backups.

Backups: Availability and Recovery Are Different Problems

Amazon RDS supports automated backups and manual snapshots.
Automated backups support point-in-time recovery. For standard RDS DB instances, the configurable retention period is generally 0–35 days, with zero disabling automated backups. The AWS console normally defaults to seven days for a newly created instance, while defaults can differ when using APIs or infrastructure-as-code tools.
Manual snapshots are useful for longer retention and deliberate recovery points. They remain available until deleted, subject to applicable service and retention policies.


A reliable recovery strategy should include backup retention, recovery objectives, restore testing, and protection against accidental deletion.

Security: Managed Doesn't Mean Responsibility-Free

RDS databases run inside an Amazon VPC. Production databases should generally use private subnets and allow network access only from approved application components.
Security groups control permitted network connections. IAM policies manage permissions to perform AWS RDS management operations. Database authentication controls who can access the data itself, and supported engines can use IAM database authentication where configured.
Encryption at rest and TLS connections provide additional protection.
The principle is simple: AWS can manage much of the infrastructure, but you remain accountable for protecting your application and its data.



Lesson 3: Purpose-Built Databases One Database Cannot Solve Every Problem

Why AWS Offers Multiple Database Types

Now return to our Employee Directory application.
We initially selected Amazon RDS because it was familiar. But our application doesn't need complex joins or complicated transactions. It mostly needs to store an employee record and retrieve it using an identifier.
Running a dedicated relational database instance for that workload might be unnecessary, particularly if usage changes significantly between weekdays and weekends.
This illustrates a broader architecture principle:
Don't force your application to fit a database. Choose a database that fits your application.



Exploring AWS Purpose-Built Database Services

Amazon DynamoDB: Key-Value and Document Workloads
DynamoDB is a fully managed NoSQL database designed for predictable, low-latency access at scale. It works well for user profiles, shopping carts, gaming data, and many high-traffic serverless applications.
Amazon ElastiCache: In-Memory Caching
ElastiCache helps reduce latency by keeping frequently requested data in memory. It supports Valkey, Redis OSS, and Memcached. Common applications include caching, session management, and low-latency data access.
Amazon MemoryDB: Durable In-Memory Data
MemoryDB combines in-memory performance with durable, Multi-AZ storage. It supports Valkey and Redis OSS compatibility and can serve as a primary database for applications requiring fast access to durable data.
Amazon DocumentDB: Document-Oriented Applications
DocumentDB provides a managed, MongoDB-compatible document database. It can support content management systems, product catalogs, and applications with flexible document structures.
Amazon Keyspaces: Wide-Column Data
Amazon Keyspaces is compatible with Apache Cassandra and suits applications requiring scalable wide-column data storage, such as industrial telemetry and high-volume operational workloads.
Amazon Neptune: Highly Connected Information
Neptune is a graph database designed for relationships between entities. It is particularly useful for fraud detection, recommendation systems, social connections, and knowledge graphs.
Amazon Timestream for InfluxDB: Time-Series Applications
Time-series databases organize information around timestamps. They can support monitoring, sensor measurements, IoT workloads, and operational analytics.
An important update: Amazon Timestream for LiveAnalytics stopped accepting new customers on June 20, 2025. AWS recommends evaluating Timestream for InfluxDB for new time-series workloads.
Amazon QLDB: A Historical Service, Not a New Architecture Choice
Older AWS learning materials recommend Amazon Quantum Ledger Database for immutable ledger records. However, AWS shut down Amazon QLDB on July 31, 2025.
For new applications requiring tamper-evident histories or auditability, architects must evaluate currently supported database services and implement the necessary immutability, verification, and retention controls. An ordinary database audit log is not automatically equivalent to a cryptographically verifiable ledger.
The lesson is bigger than a particular AWS product: architecture decisions must account for service lifecycle, not just technical features.



Lesson 4: Amazon DynamoDB Serverless Databases Without Server Management

Why DynamoDB Fits the Employee Directory

Our Employee Directory needs a simple way to look up employees, update profiles, and store records without running a database server continuously.
DynamoDB is a strong candidate because AWS manages its underlying infrastructure, replication, and storage scaling.
Unlike a relational database, DynamoDB organizes data using tables, items, and attributes. A table contains items. Each item contains attributes. Every item must contain the attributes that form its primary key, but other attributes may vary.



Understanding DynamoDB Data Modeling

Consider an  Employees  table.
An employee item might look like this:
{
"id": "EMP001",
"name": "Avery Chen",
"location": "Seattle",
"jobTitle": "Cloud Engineer",
"badges": ["AWS", "Coffee Enthusiast"],
"photoKey": "employees/EMP001.jpg"
}
Another employee record could contain an additional  department  attribute without requiring every other item to have that attribute.
Each item is uniquely identified using its primary key. A table can use a simple partition key or a composite primary key consisting of a partition key and sort key.
Primary-key choices are critical because DynamoDB works best when data models are designed around known application access patterns.
For example, retrieving an employee by ID can be efficient. Searching broadly across arbitrary attributes may require secondary indexes, different data modeling, or less efficient scans.
Flexible schema does not mean architecture without planning.

DynamoDB Performance and Scaling

DynamoDB is designed to deliver single-digit millisecond performance for supported access patterns at scale.
AWS distributes data across underlying infrastructure and replicates information across multiple Availability Zones.
Developers do not manually provision or maintain the physical database servers.
However, good performance still depends on partition-key distribution, item sizes, indexes, capacity settings, and efficient queries.
A poorly designed partition key or excessive table scanning can create bottlenecks and unnecessary costs even in a managed database.

Understanding DynamoDB Pricing

DynamoDB offers different throughput-capacity modes.
On-demand capacity bills for consumed read and write requests rather than continuously reserved throughput capacity. It can be attractive for unpredictable or intermittent workloads.
Provisioned capacity allows teams to define read and write throughput, with optional auto scaling. It can be cost-effective for workloads with predictable demand.
Storage, backups, data transfer, and optional features can create additional charges depending on configuration.
For our Employee Directory, an on-demand table might align well with irregular activity. But the cost advantage should be validated against actual workload estimates.
A workload that is idle on weekends can still incur storage-related charges.

Security and Reliability in DynamoDB

DynamoDB encrypts stored user data at rest and integrates with AWS Key Management Service.
IAM policies and roles control access to DynamoDB operations. Amazon CloudTrail helps audit API activity, while Amazon CloudWatch provides operational metrics and alarms.
Point-in-time recovery and on-demand backups are available to support recovery strategies, but must be configured appropriately.
DynamoDB also supports transactions for applications requiring coordinated writes across multiple items.
This matters because DynamoDB is not simply a fast, unstructured storage system. It is a database platform with its own transaction, consistency, indexing, and operational design considerations.

When DynamoDB Is the Wrong Choice

DynamoDB may not be ideal when your application requires frequent ad hoc joins, highly flexible analytical queries, or complex relational reporting.
Those requirements might be better suited to a relational database or a purpose-built analytics platform.
The decision is not SQL versus NoSQL as competing philosophies.
It is access patterns, consistency needs, operational complexity, and cost.



Lesson 5: Choosing the Right AWS Database Service

Start With Requirements, Not Product Names

Architecture becomes easier when you stop asking, "Which AWS database is best?" and start asking, "What must my application do?"
Before choosing a database, identify how data will be written, how users will retrieve it, which relationships matter, how quickly responses must arrive, and how usage may grow.



AWS Database Selection Guide

Application requirement
AWS service to evaluate
Traditional SQL transactions, ERP, CRM
Amazon RDS
MySQL/PostgreSQL-compatible cloud relational workloads
Amazon Aurora
High-scale key-value lookups and serverless applications
Amazon DynamoDB
Frequently accessed data and caching
Amazon ElastiCache
Durable, high-performance in-memory storage
Amazon MemoryDB
Flexible document-oriented data
Amazon DocumentDB
Cassandra-compatible wide-column workloads
Amazon Keyspaces
Fraud relationships and recommendation graphs
Amazon Neptune
Time-series ingestion and queries
Amazon Timestream for InfluxDB
Analytical SQL and data warehousing
Amazon Redshift
This table is a starting point, not an automatic selection rule.
For example, Redshift is designed primarily for analytical workloads and data warehousing, not as a direct replacement for a transactional RDS database.
Similarly, choosing DynamoDB for a user-profile application does not mean every user-profile system belongs on DynamoDB.

Modern Architecture Often Uses More Than One Database

An e-commerce platform might use a relational database for orders, DynamoDB for shopping carts, ElastiCache for frequently accessed session information, and Redshift for analytical reporting.
Each database supports a different workload.
This approach can be powerful, but it also introduces synchronization, operational, security, and data-governance complexity.
Multiple databases should be introduced because they solve real requirements not because a system diagram looks more impressive.
Complexity is a cost. Spend it only where it creates value.



Lesson 6: Hands-On AWS Implementation Building the Employee Directory With DynamoDB

We have reached the practical part of our architecture journey.
Our application already runs on EC2, and employee photographs are stored in S3. Now we will connect it to DynamoDB for employee records.
The original training application was built to support either an RDS or DynamoDB backend. That matters: switching databases in an ordinary application may require substantial code and data-model changes.

Step 1: Prepare the EC2 Application

Open the EC2 console and identify the working Employee Directory instance with S3 functionality.
Use the existing instance configuration or an appropriate launch template to create a new test instance.
Give the new instance a clear name, such as:
 employee-directory-app-dynamodb 
Confirm that its application configuration, instance profile, and networking settings are correct.
For a controlled demonstration, the application may be accessed through a public endpoint. In production, prefer private EC2 instances behind an appropriately secured application load balancer, with AWS Systems Manager used where suitable for administration.

Step 2: Confirm the Application Is Running

Wait for the instance status checks to pass.
Open the application's permitted endpoint and confirm that the Employee Directory loads successfully.
This isolates the infrastructure test from the database test.
If the website fails before DynamoDB is created, investigate EC2 networking, application startup, logs, and instance configuration before continuing.

Step 3: Create the DynamoDB Table

Open the AWS Management Console and navigate to DynamoDB.
Select Create table.
Use the values expected by this demonstration application:
Setting
Value
Table name
 Employees 
Partition key
 id 
Partition key type
String
Sort key
None for this example
Capacity mode
On-demand for this example
The table name and key must match the application configuration, including capitalization.
Create the table and wait until its status is Active.

Step 4: Verify IAM Permissions

Ensure the EC2 instance has an appropriately scoped IAM role allowing the application to access the required DynamoDB table.
Depending on the application, necessary actions might include:
 dynamodb:GetItem 
 dynamodb:PutItem 
 dynamodb:UpdateItem 
 dynamodb:DeleteItem 
 dynamodb:Scan 
Grant only the permissions the application actually needs. A production application should not receive unrestricted DynamoDB administrative access.
The existing S3 integration also needs the appropriate bucket-level or object-level permissions.
Avoid embedding long-lived AWS access keys in application source code.

Step 5: Add an Employee

Return to the Employee Directory application.
Select Add Employee and enter a test profile:
Name: Avery Chen Location: Seattle Job Title: Cloud Engineer Badges: AWS, Coffee Enthusiast
Upload a profile photograph.
Save the employee.
If the application is correctly configured, it should persist the employee record in DynamoDB and the photograph in S3.

Step 6: Verify That the Data Was Stored

Open DynamoDB and select the  Employees  table.
Use Explore table items to locate the new employee.
Confirm that the record contains the expected employee ID, name, job title, location, badges, and photo object reference.
Next, open the associated S3 bucket and confirm that the uploaded photograph exists.
You have now verified both the structured employee data and the object-storage integration.



Step 7: Clean Up Test Resources

Stop or terminate temporary EC2 instances as appropriate.
Remember that stopping an EC2 instance does not necessarily eliminate every associated charge. Attached EBS volumes and other provisioned resources may continue to incur costs.
The DynamoDB table and S3 bucket may also generate charges while retained.
Delete resources that are no longer needed, but preserve any data required for subsequent lessons.
The practical achievement here is not merely creating a table.
It is connecting multiple AWS services into one working application while giving each service a clearly defined responsibility.



Lesson 7: Knowledge Check Can You Choose the Right Database?

Question 1: Which AWS database supports items with different attributes?

Imagine an architect building an application where individual records contain varying attributes.
One user profile includes a preferred language. Another includes notification settings. A third includes an optional department.
Which AWS database is a strong candidate?
Answer: Amazon DynamoDB.
DynamoDB supports flexible item attributes. Records must contain the attributes required for their primary keys, but other attributes can vary.
This flexibility makes DynamoDB useful for many applications with semi-structured data.
That said, the complete decision still depends on the application's queries and access patterns.

Question 2: What Is the Customer Responsible for When Using Amazon RDS?

Consider a team operating a managed relational database on AWS.
AWS manages much of the underlying infrastructure and maintenance.
Does that mean the customer no longer needs database expertise?
Answer: No. The customer remains responsible for database optimization and application-level database management.
That includes query performance, indexing, schema design, access controls, and appropriate configuration.
AWS manages infrastructure components, but it cannot automatically understand every application's business requirements.



Final Takeaway: The Best Database Is the One That Removes the Right Problems

Our Employee Directory began with a conventional architectural choice: Amazon RDS.
It was a reasonable starting point. Relational databases are reliable, mature, and powerful.
But after examining the application's actual requirements, DynamoDB became a compelling alternative.
The application mainly needed predictable employee lookups, flexible records, managed scaling, and straightforward integration with AWS services.
That doesn't make DynamoDB universally superior to RDS.
It demonstrates a more valuable lesson.
Use RDS when relational capabilities create value. Use DynamoDB when its access model and operational characteristics fit. Use purpose-built databases when a specific workload genuinely benefits from them.
And never confuse managed infrastructure with managed architecture.
AWS can automate provisioning, replication, and much of database maintenance. It cannot replace thoughtful data modeling, security design, recovery planning, or cost evaluation.
The strongest cloud systems are not necessarily the ones with the most services.
They are the ones with the fewest unnecessary decisions, the clearest responsibilities, and the right tools for the job.
Build for the workload. Design for failure. Optimize for value.

Official AWS Documentation

Open to Cloud Ops Remote and technical writing projects.

Series: Skill Builder Digital Classroom - AWS Cloud Technical Essentials (11 articles)

  1. …
  2. 7
    AWS Databases Explained: RDS vs DynamoDB & When to Use Each This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article