Choosing a database is one of those decisions that can look simple at the beginning of a project.
You need to store some data, so you pick a database and start building.
But once you start thinking about scale, queries, cost, performance, and maintenance, the decision becomes much more interesting.
As a Node.js backend developer, I've mostly worked with MongoDB, but while learning and working with AWS, I've spent more time understanding how AWS database services such as Amazon RDS and Amazon DynamoDB fit into backend architectures.
They solve very different problems.
Here's how I approach the decision.
The data shape comes first
Before choosing a database, I think about the data and, more importantly, how the application will access that data.
For example, imagine an e-commerce application.
We might have:
Users
Products
Orders
Payments
Reviews
An order might contain relationships between multiple entities:
User
↓
Orders
↓
Products
↓
Payments
If the application requires complex relationships, joins, transactions, and flexible SQL queries, a relational database becomes very attractive.
That's where RDS can make sense.
But not every application needs that model.
Imagine an application where the primary access pattern is:
Get user by ID
Get user's notifications
Get latest notifications
Mark notification as read
If these access patterns are predictable and the application needs massive scalability, DynamoDB becomes an interesting option.
The key lesson is:
Don't start with the database. Start with the data and access patterns.
What pulls me toward RDS
Amazon RDS provides managed relational databases such as:
- PostgreSQL
- MySQL
- MariaDB
- Oracle
- SQL Server
One of the biggest advantages is the relational model.
For applications with relationships between entities, SQL can make the data model and queries much easier to reason about.
For example:
SELECT
users.name,
orders.id,
orders.total
FROM users
JOIN orders
ON users.id = orders.user_id
WHERE users.id = 1001;
This type of relationship-oriented query is natural in a relational database.
RDS is particularly attractive when I need:
- Complex queries
- Relationships
- Joins
- Transactions
- SQL
- Reporting
- Existing relational database expertise
Another advantage is that many backend developers already understand SQL and relational database design.
That can significantly reduce the learning curve.
What pulls me toward DynamoDB
DynamoDB is fundamentally different.
Instead of starting with relationships and joins, I think about access patterns.
For example:
GetUserById
GetOrdersByUser
GetLatestOrders
GetOrderById
The table and indexes are designed around how the application will query the data.
This approach can be extremely powerful for applications that need:
- High scalability
- Low-latency access
- Predictable access patterns
- Serverless architectures
- High request volumes
- Automatic scaling
DynamoDB also removes much of the traditional database server management.
That makes it particularly interesting when building serverless applications with services such as Lambda and API Gateway.
The architectural difference
A traditional RDS-based backend might look like:
Client
↓
API
↓
Node.js / Express
↓
Amazon RDS
The application connects to a relational database and performs SQL queries.
A serverless architecture could look like:
Client
↓
API Gateway
↓
Lambda
↓
DynamoDB
Here, the database fits naturally into an event-driven or serverless architecture.
Neither architecture is automatically better.
The workload determines which one makes more sense.
What about MongoDB?
This is especially relevant to me because my backend experience includes MongoDB.
MongoDB uses a document-oriented model:
{
name: "Sahinur",
email: "user@example.com",
skills: [
"Node.js",
"Express",
"MongoDB"
]
}
This can be very convenient for applications where the data naturally fits into documents.
It also feels familiar when working with JavaScript and Node.js.
That experience made me realize something important:
Database choice isn't only about technical specifications.
Developer experience, existing knowledge, application requirements, and team expertise all matter.
How I would make the decision
If I were starting a new AWS backend, I'd ask these questions first.
1. Do I need complex relationships?
If the application heavily depends on relationships and joins, I'd lean toward a relational database such as RDS.
2. Are my access patterns predictable?
If I know exactly how the application will read and write data and need highly scalable low-latency access, DynamoDB becomes more attractive.
3. Do I need SQL?
If the team relies heavily on SQL queries, reporting, and relational data analysis, RDS is likely the easier choice.
4. Is the application serverless?
If I'm building around Lambda and API Gateway, DynamoDB can fit naturally into that architecture.
5. What does the team already know?
A technically powerful database isn't useful if the team doesn't understand how to model and operate it effectively.
A simple comparison
| Factor | RDS | DynamoDB |
|---|---|---|
| Database model | Relational | NoSQL |
| Query model | SQL | Key/index based |
| Joins | Yes | No traditional joins |
| Transactions | Strong relational transactions | Supported, but different model |
| Scaling | Managed, but capacity planning still matters | Designed for large-scale automatic scaling |
| Schema | Structured | Flexible |
| Best fit | Relational applications | High-scale access-pattern-driven workloads |
| Serverless fit | Possible | Excellent |
The biggest lesson
The biggest lesson I've learned while studying different database architectures is:
Don't choose a database because it's popular. Choose it because its data model matches your application.
A database can be extremely fast and scalable but still be the wrong choice if your application's access patterns don't fit it.
Similarly, choosing a relational database when your application has simple key-value access patterns can introduce unnecessary complexity.
What I'd do before committing
Before choosing a database, I'd write down the application's most important operations:
1. Create user
2. Get user by ID
3. Get user's orders
4. Create order
5. Update order
6. Get latest orders
7. Generate reports
Then I'd evaluate how naturally each database handles those operations.
This exercise can reveal more than a generic database comparison ever will.
Final takeaway
For me, the RDS vs DynamoDB discussion isn't really about which service is better.
It's about matching the database model to the application.
If I need relational data, SQL, joins, and complex queries, RDS is a strong candidate.
If I have predictable access patterns and need highly scalable, low-latency NoSQL access, DynamoDB is worth serious consideration.
And my experience with MongoDB has reinforced the same principle:
The right database is the one that makes your application's most important operations simple, reliable, and scalable.
That's the way I now approach database decisions when designing backend systems on AWS.
Top comments (0)