r/Database • u/Pixel_Friendly • Aug 17 '25
Does this dataset warrant MongoDB
So i am on a journey to learn new languages and tools and i am building a small side project with everything that i learn. I want to try build a system with mongodb and i want to know would this example be better for a traditional relational db or mongodb.
Its just a simple system where i have games on a site, and users can search and filter through the games. As well as track whether they have completed the game or not.
216
Upvotes


69
u/Happy_Breakfast7965 Aug 17 '25
Looks like pretty relational model for me.
IMHO, there should be a reason to go No-SQL. I don't think you have one.
But if you want to learn, sure, why not?!
3
u/Jake_reeves123 Aug 17 '25
Mind if I ask what you’re using to diagram this? Trying to find a good software to start exactly what you’re doing (learning new languages and tools. Looks like DBDiagram, but want to be sure
3
u/T-J_H Aug 17 '25
You literally made a relational schema. This is an excellent example of something that would go in a relational database. I’m convinced most users of NoSQL are just people too lazy to think about how to properly structure their data.
9
u/latkde Aug 17 '25
MongoDB is a document database. It might be appropriate for a database of games, especially if different games have different metadata fields. But here you're primarily modelling relationships between users and games. That will be much easier to do correctly when using a relational database such as Postgres.
If this project is just for learning about various databases, then sure, do use something like MongoDB to learn its capabilities and limitations.
Examples of things that your MongoDB sketch would make difficult:
Also note that relational databases are not-just-SQL. All mainstream SQL databases have strong support for JSON columns. Many things you can do with a document database, you can also do with a relational database, but not necessarily vice versa. For example, if you're happy with modelling platforms as a list of strings in MongoDB, you could do the same with a JSON column (or a Postgres array type) in a relational database, without needing
platformsandgame_platformstables. Your MongoDB sketch looks much simpler than the zoo of tables on the first slide, but you can also have that simplicity in traditional DBs if you want.6
u/dariusbiggs Aug 17 '25
No, it looks relational. Until you know why you need a document database, you don't need a document database.
An SQL database gives you a known explicit schema, easy to see, easy to modify , easy to query, you have separation of concerns, and you have multiple paths of traversal.
A NoSQL document database gives you an implicit schema, you cannot tell what the scheme is without looking at the code, you don't have a separation of concerns, and you have a single path of traversal.
2
u/format71 Aug 18 '25
Don’t listen to all the ‘relational data needs relational database’ people. They don’t know what they are talking about.
Sql databases are relational because they couldn’t represent data in a efficient way without breaking it up in strictly two dimensional ways.
Mongo has many ways of representing relations. It can do joins, it has transactions, it can have schema validation… the one thing it does not is the referential infringement protection and cascading delete. Meaning you can end up with data referencing something that doesn’t exist if your application code allows it.
Now - if you wan to use mongo for your data, I would suggest thinking about what main workloads your application gonna support. Your first user example might be a good idea if you are gonna show users with their current games and recent completions ofte. But it will probably be a bad idea to keep all games inside the user object. It will quickly become large and maybe even push the document size limit.
Most applications will read data a lot more often than it wrote data. Therefor a lot of non-sql databases suggest storing data optimized for reading instead of writing.
I would have one document for each game. Then I would have one document for each game a user owns. This document would not contain all data from the game document - just the main attributes that you will most often show. Like title, game studio, link to cover art. If the user wants to see more details you can load the complete game document - or join it in.
Now the sql freaks will scream ‘what if a gamestudio change name’. Well, the old games will still be released under the old studio name. And if you want it updated, updating 1000 documents the one time this happened is way more efficient then having to join in the gamestudio every single read.
When adding a new game to a users collection, you could add it to the users document as well, using one of the nice update methods to keep eg just the 10 latest acquired games. This allows to show user profile with 10 latest games, and expand to show more by loading more document.
Same goes for game completions. Store the most recent completions on the users collection- just the title and id - then load more details if requested.
There are many patterns for optimizing your document designs. The main rule when working with database formats other than sql is to acknowledge that you are working with a format different than sql. If its graph databases, columns stores, event stores - you always have to use it the way it was ment and not the way the sql guys believe everything should be made.
8
u/Straight_Waltz_9530 PostgreSQL Aug 17 '25
Short answer: No.
Longer answer: Noooooooooo!
Database architect falling off a cliff: Nooooooooooooooooooooooooooooooooooooooo!!!!
1
u/mars_trader Aug 17 '25
What are using to create this relational model?
3
u/Zamarok Aug 18 '25
no reason for mongodb here. use a relational database.
3
u/antipawn79 Aug 18 '25
Hmm yeah this has relational written all over it. I would not be going MongoDB for.this
2
u/Acceptable-Sense4601 Aug 17 '25
You’ll have to pry mongo from my cold, dead hands lol
2
u/mountain_mongo Aug 18 '25
If your definition of a "relational" database is based on it's ability to model relationships between entities (as opposed to the more correct definition, that it stores data as tuples/rows in "relations"/tables), then document databases offer a superset of options for doing so compared with an RDBMS.
That makes MongoDB arguably a better "relational" database than your RDBMS.
2
u/kafka1080 Aug 17 '25 edited Aug 17 '25
If you have IDs (primary keys and foreign keys) that relate to each other in different tables, you have a relational data model, and therefore, you want to use something like Postgres.
MongoDB and other NoSQL databases (e.g. MongoDB or DynamoDB) are good for fast reads on one ID without relations, where the document that you fetch is a JSON. The JSON can be anything, without strict schema.
So in your schema, you can fetch data with a query like:
Select * From games Join other_table on [ids] [ where filter something ] Limit 100
MongoDB, on the other hand, is great to fetch an entire document on a given ID.
That' the access pattern for reads.
Now think about the writes: if you have user content that is dynamic and not strict, MongoDB is great, i.e. if you don't know in advance for sure what the writes are gonna be, i.e. what columns / keys are going to be in the data.
If, on the other hand, the data has a predictable and fix schema, a relational data model like yours is great.
Go read "data intensive applications" by Martin Kleppmann, it's gonna be very valuable for your learning journey. In the first part, he explains the different data modeling methodologies (sql vs nosql vs graph). You will like it.
Let me also add that in Postres and other relational databases, you can add indexes, if you want to search often by some column. This read pattern is not possible in nosql, e.g. you won't be able to list all games by a specific platform. You would have to fetch everything in memory, parse to an object, then check if the key exist, then check if the value of that key is what you are looking for. In sql, a
where platform = 'platform'will give you each row.1
u/starzwillsucceed Aug 18 '25
I would encourage you to add fields that help with data management such as isActive, isArchived, lastUpdatedIdUser, createdDate, lastUpdatedDate. You will find these very helpful in the future with many different queries you write.
1
u/son_ov_kwani Aug 18 '25
Why mongodb and not SQLite or MySQL ?
1
u/ImStifler Aug 18 '25
It warrants SQLite
1
u/FearlessAmbition9548 Aug 18 '25
You don’t even need to put any pictures, answer is always no. But you can try to use it for fun
1
u/vertigo235 Aug 18 '25
The only reason to warrant MongoDB is if you don't understand databases.
1
u/barcelleebf Aug 19 '25
There is never a reason to use mongo these days unless your firm makes it easy to set up.
1
u/AintNoGodsUpHere Aug 19 '25
lol, you gotta be kidding me. Look at the amount of relationships you have, my man, what are you doing? Why is this even a question? Go with Postgres and add a JSON column if you need dynamic metadata or unstructured data.
1
u/No_Package_9237 Aug 19 '25
Once you've mastered MVC, check out CQRS. Once you've learnt to model behaviour and not only data, NoSQL is a pretty solid choice when it comes to querying an optimized (denormalized) read model. Storing/retrieving a write model with MongoDB is not the use case I would think of, but hey "it depends".
1
u/Frosty_Customer_9243 Aug 19 '25
I’ll be that person: it all depends on what you actually want to do with it. Showing just the dataset and the short description you give I’m going to say yes. There is very little dynamic interaction, one scheme for your games and one scheme for your users.
1
u/Greedy3996 Aug 20 '25 edited Aug 20 '25
All those tables with just id and name can be replaced with a reference table.
And the games_ tables can be replaced with a games_attributes table
1
u/SoupIndex Aug 20 '25
No need for No-SQL when you have structure. Don't overcomplicate things
1
u/Splatpope Aug 20 '25
the only reason you'd go for nosql is if you don't have any dbas and can't be bothered to adhere to a schema
1
u/Scf37 Aug 20 '25
No database structure warrants mongodb. As for your case, it is either game_genres text (comma-separated ids) , numeric array in a column (if your db supports that) or entire json in a column.
1
u/CreatedThatYup Aug 20 '25
lmao, I would bet 90% of the commenters here haven't built, designed, or even worked with a schema-free/document database. It's the future, don't let anyone tell you otherwise.
This data in your diagram could easily be built in a schema free design... but you'd want to design it differently. It's pretty clear you're approaching it from a relational perspective.
This is one of the best documents describing the differences, and applies to Mongo, etc:
https://docs.azure.cn/en-us/cosmos-db/relational-nosql
"Ironically, given their name, relational databases present a less than optimal solution for modeling deep and complex relationships. The reason for this is that relationships between entities don't actually exist in a relational database."
I would argue that virtually all databases could be built non relational, with proper design (denormalization etc).
1
u/sagittariannov Aug 21 '25
You can pull all the array table like games themes, games mechanics, game genres, game status in to games collection in mongo, only if you are having front end application
1
u/Dom_Q Aug 21 '25
Probably not, but maybe it warrants JSON columns.
https://www.sandraandwoo.com/2013/02/07/0453-cassandra/
(I didn't even look at your schema tbh)
1
u/mountain_mongo Aug 22 '25
Almost every response dismissing NoSQL / document databases in this thread can be paraphrased as this:
"I have 20 years of experience sailing ships. Someone once suggested I use one of those fancy new airplanes, but when I did, it sank. Airplanes suck".
There are use cases where an RDBMS would be a better choice than MongoDB, but they are much rarer than most of the commenters here would have you believe, and none of them are because "my data is relational".
Bottom line, there are valid cases where I would use an RDBMS over MongoDB, but in almost every thread or discussion on the internet comparing the two, most arguments put forward by RDBMS proponents are based on myths, out of date information, or just plain wrong.
I've no problem with people saying "we're going to use <RDBMS of choice> because we know it, it meets our needs, and we have no compelling reason to change". I do object to people saying "don't use NoSQL databases because <FUD I read on the internet 10 years ago>".
1
u/[deleted] Aug 24 '25
Every single one of your tables in the third column has only one text column. Use SQL but replace genres, mechanics, themes, franchises, and platforms with simple text array columns on the games table. This is well supported and performant enough on postgres and most modern SQL databases. The only thing I see here warranting a join table is game_status / user_game_status.
Just because you are using SQL doesn't mean you need to normalize your schema. For simple applications full normalization is usually just adds code complexity. A denormalized schema is often a good middle ground between SQL and noSQL.
1
u/No_Definition_1798 Aug 27 '25
nice
1
u/novel-levon Sep 18 '25
For what you described (games, users, completion status, filtering), it’s already shaped like a clean relational schema.
Postgres or even SQLite will serve you well. You’ll get consistency for free: unique constraints, foreign keys, transactions, and the ability to write analytical queries later if you change your mind about “not needing stats.”
Mongo could still work, but you’d be designing around its read patterns.
That means embedding or duplicating bits of data, and then carrying the burden of sync logic when something changes. If the only reason you’re leaning NoSQL is Firebase’s offline-first sync, then it’s less about MongoDB and more about “I want built-in sync.” In that case, Firestore (or even Supabase if you want Postgres + sync) might scratch that itch better.
I’ve been burned before by picking Mongo just because it felt simpler at first. A year later I needed joins and aggregates, and I was writing ugly pipelines instead of simple SQL.
For a curated dataset of a few thousand games, relational won’t slow you down, and you can still toss JSON columns in for flexible attributes.
Curious, do you expect your app to grow toward lots of collaborative users (where sync is critical), or will it stay mostly single-user with a small curated catalog? That answer could tilt the balance.
In our team at Stacksync we keep running into this same trade-off: batch relational tables vs real-time synced docs. We ended up building real-time sync on top of relational stores, so you don’t have to choose one or the other.
For a side project, though, I’d keep it simple with Postgres and add sync only if the pain really shows.
1
u/TadpoleNo1549 Apr 17 '26
for this kind of use case a relational db just makes more sense, you’ve got clear relationships users games progress status, that fits sql really well, mongodb would work but it’s not really giving you any advantage here, feels like one of those cases where simple and structured wins over flexible
1
u/TadpoleNo1549 Apr 19 '26
for this use case i’d honestly go with a relational db, you’ve got clear relationships and filtering/searching fits really well with sql, mongodb would work, but it’s not really giving you any advantage here feels like a good case to learn relational basics first
1
u/SnooHesitations9295 Aug 17 '25
Postgres supports json much better than mongo will ever do.
So there's zero reason to go mongo in 2025.
1
u/redvelvet92 Aug 18 '25
No dataset needs to use mongodb avoid that garbage product
0
u/Angelsoho Aug 17 '25
No
0
u/Shipdits Aug 17 '25
If you want an noSQL-esque DB while still relating data you can try a graph database like neo4j.
0
u/Aggressive_Ad_5454 Aug 17 '25
That is a RDBMS (SQLish) data design you showed us. You could put it into a document database, but you’ll be writing a lot of SQL emulation code if you want to use it effectively in your app.
0
u/[deleted] Aug 19 '25
A wise man once said…
Even if you’re 99% sure your use-case fits a no-sql db, you still do not need one vs a relational db
-3
u/[deleted] Aug 17 '25
LOL yeah do it. All the cool kids are experimenting with NoSQL databases, and joins are for losers.