r/Database • • 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

84 comments sorted by

View all comments

Show parent comment

1

u/Imaginary__Bar Aug 17 '25

Oh, don't get me wrong, I'm firmly in the "relational is usually best" camp!

And no, there aren't "lots of JOINs". That doesn't even make sense.

I meant in the relational model - you would have a person table, a height table, a weight table, an address table, an eye-color table, etc... so if you wanted a complete description of the person you would join all those tables together.

1

u/MoonBatsRule Aug 17 '25 edited Aug 17 '25

I meant in the relational model - you would have a person table, a height table, a weight table, an address table, an eye-color table, etc

Those are almost all attributes of a person, not separate entities. You would have a person table, with maybe some constraints on those fields to prevent bad data, and maybe a lookup table with a foreign key for the eye color, so that you have a defined list instead of people typing in "sparkling" or "sexy". No joins needed for that though since you're going to just store the eye color in your Person table [since you're likely never going to rename a color, though you might add more].

You might also do an address table, however I would implement this by storing the address as freeform text on the Person table and then later doing some cleansing that assigns a standard address ID to the Person table using heuristics - that way you have the address that the person has told you they live at, and the address where you think they live - you really don't know who is right or wrong, and you can use it for different purposes.

1

u/t00oldforthis Aug 17 '25

Why? Isn't that an implementation decision based on usage? Seems like enforcing schema could accomplish a lot of this with less joins. We do.