Asked 13 days ago
3
292
Hey everyone! Need some real-world perspectives here, if you don't mind sharing 🙏
I'm building along with DevFlow. The data feels pretty classic relational: users → questions → answers → votes, plus tags and joins. JS Mastery used MongoDB + Mongoose, and the schema ends up looking very SQL-ish (with refs, required fields, populate, etc.). What keeps bugging me is this: technically both SQL (e.g., Postgres) and NoSQL (e.g., MongoDB) can handle these patterns. But beyond “both work,” why do we really pick one over the other?
I’m genuinely trying to go past surface-level answers and see why someone experienced (like JSMastery) might still choose Mongo over SQL in a clearly relational project:
Was it developer speed?
Familiarity?
Or is there a hidden advantage I'm missing?
If you’ve actually shipped something similar: What made you pick one? Did it save you pain later, or add hidden complexity? Really appreciate any thoughts! Trying not to settle for “it works,” but to understand why it fits. Thanks! 🙌
The user's answer provides a great starting point for this discussion. While both SQL and NoSQL databases can handle relational data structures, there are several reasons why MongoDB might be a better choice for certain projects.
One significant advantage of using MongoDB is its ease of use and rapid development capabilities. With MongoDB, you can quickly create and populate your database without having to worry about complex schema designs or SQL queries. This can be particularly beneficial for projects with tight deadlines or rapidly changing requirements.
Another reason to choose MongoDB is familiarity. If your team is already experienced with MongoDB and its ecosystem, it can be easier to stick with what you know rather than learning a new database technology. This familiarity can also lead to faster development times and reduced errors.
In addition to these benefits, MongoDB offers several hidden advantages that can make it a better choice for relational data structures. For example:
So, when should you choose MongoDB for your relational data structures? Here are a few scenarios where MongoDB might be a better choice:
In conclusion, while both SQL and NoSQL databases can handle relational data structures, MongoDB offers several advantages that can make it a better choice for certain projects. By considering factors such as developer speed, familiarity, and hidden advantages, you can make an informed decision about which database technology is best for your project.
In conclusion, while both SQL and NoSQL databases can handle relational data structures, MongoDB offers several advantages that can make it a better choice for certain projects. By considering factors such as developer speed, familiarity, and hidden advantages, you can make an informed decision about which database technology is best for your project.
Development speed
MongoDB with Mongoose is super beginner-friendly. You can just define schemas in JavaScript, and start saving documents without worrying about migrations, joins, or strict typing. It's great for solo devs or small teams, or when you are not sure about the final shape of your data when starting out.
Flexibility
Mongo is or schema-optional, so if your data evolves quickly — say you're tweaking your data structure while building fast — you don’t need to constantly update your database schema. This can really speed things up during prototyping. Familiarity Mongoose models are almost identical to the objects we are using on the front end, and the syntax is basically the same, so if you have some previous experience with JS/TS, you don't really have to learn a lot to start using it. For me it feels more "natural" than ORMs for SQL databases.
What about Postgres / SQL?
SQL databases shine when:
To answer your questions:
Does forcing MongoDB to act relational cause issues?
Sometimes, yes:
.populate()
for that, but it's not as fast as SLQs join
, and if you have to create complex queries, then things might get a bit slow or messy.,What to choose:
For rapid development, experimenting, iterating, flexibility - go with Mongo.
For tight validation, data stability, very complex queries, and speed (speed starts to matter when we are talking about a scale of tens of thousands of operations, but generally SQL is faster) - choose SQL
0
0
0
0
2
0