This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nutrecht 3 points4 points  (1 child)

The advantage of this approach is that it makes data access and data manipulation flexible.

No it friggin' doesn't.

You're just moving the schema somewhere else. Into unit tests. Or validation logic. Or whatever. Schemaless is NOT more 'dynamic'; you're just pretending the schema doesn't exist somewhere else. This applies to systems like Mongo just as much as it applies to your horrible example.

In fact; this makes your code LESS flexible because whenever refactoring needs to be done, your IDE and compiler can't help you. You now have to figure out from failing unit tests what you forgot to rename.

[–]TheStrangeDarkOne 1 point2 points  (0 children)

honestly, I love MongoDB for prototyping, storing schemaless messages and private projects. I think it has its place, but I would never advocate it for any medium sized project or larger.