Hey everyone! I'm a junior software engineer working on a backend application using FastAPI, and I need to figure out how to store both relational and non-relational data. Rather than managing separate SQL and NoSQL databases, I'm thinking about using DynamoDB as my sole database solution. Before I make any final decisions, I want to get your thoughts on the potential downsides regarding maintainability, scalability, data modeling, or flexibility in the long run when using DynamoDB for workloads that involve many-to-many and many-to-one relationships. Would it be a better approach to utilize a relational database like PostgreSQL alongside DynamoDB for handling more relationship-heavy data? I'm eager to hear your insights or any edge cases I should keep in mind. Thanks!
5 Answers
Honestly, using DynamoDB for relational data can lead to performance issues and extra costs. I would typically suggest going with a relational database like PostgreSQL and opting for NoSQL only where a flexible schema is essential. If your data models can’t be defined upfront, consider introducing both—DynamoDB for flexibility and a relational database for relational data.
While DynamoDB isn’t relational, AWS has decent documentation on modeling one-to-many and many-to-one relationships. If you properly plan your access patterns and your data model, it might work. Your app's hierarchical needs with users, folders, and files could be managed in DynamoDB as long as you're ready to tackle the non-relational aspects.
DynamoDB isn't designed to be a relational database; it's more of a key-value store. I think you'd fare better using a relational database for your relationship-heavy data or just sticking with two databases. You might encounter issues if you try to force relational structures into DynamoDB, as it can get slow and costly, depending on your access patterns.
Make sure you understand your access patterns up front. If your schema is complex, it may be better to weigh your options carefully—DynamoDB might not be ideal for certain relational workloads. Consider the long-term implications of scaling with both systems before deciding.
DynamoDB can handle relational data structures, but it's not without compromises. You won't have the same level of support for joins and constraints as with a relational database. If you need strong relational features, sticking with PostgreSQL while using DynamoDB for more flexible data storage might be the best way to go.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically