Why you should never use MongoDB (2013)
My first introduction to databases was with PHP&#x2F;MySQL, where normalization was the name of the game. The whole point of normalization is that there is <i>no</i> duplication of data anywhere. If it&#x27;s possible for duplicate data to exist, that&#x27;s a symptom of a design flaw in the schema.<p>I&#x27;ve been using Mongo recently, and every time I raise criticism of it, the counterargument I hear is &quot;forget about normalization! Duplication is okay.&quot;<p>Like the author, I really cannot wrap my head around this. While I understand that duplicating documents across collections may make querying faster, what about when you want to change the document? You need to propagate the change across every duplicate of the document in every collection where it exists. This means that any &quot;de-duplication&quot; logic needs to happen at the application level, rather than the database level.<p>Parse.com provided an interesting abstraction around that with &quot;cloud code&quot; and beforeSave and afterSave triggers. To maintain consistency, they encourage propagating updates to a document within its collection&#x27;s beforeSave function. So if a document changes in one collection, you write code to change all instances of the document in other collections. That&#x27;s nice in that it almost <i>feels</i> like you&#x27;re writing the dedeuplication logic in the database layer, because you can view the &quot;beforeSave&quot; and &quot;afterSave&quot; functions as extensions of the schema. As long as those functions are up to date, the schema and any pseudo-linked documents will stay up to date.<p>But I really don&#x27;t buy it. The strengths of mongo encourage a design that necessitates complexity for any significant write operation.<p>I think the real issue is that &quot;if you have a hammer, everything looks like a nail.&quot; Mongo and other NoSQL stores have some real use cases, but people who are more familiar with Mongo than RDBMS are too trigger happy to employ it as a solution to problems where a RDBMS is the clear solution.