Hacker News new | comments | show | ask | jobs | submit login

An excellent and practical article. I do want to emphasize one thing, though, since I feel like the article almost seemed to downplay its significance:

MongoDB does not support joins; If you need to retrieve data from more than one collection you must do more than one query ... you can generally redesign your schema ... you can de-normalize your data easily.

This is a much larger issue than it seems - nested collections aren't first class objects in MongoDB - the $ operator for querying into arrays only goes one level deep, amongst its other issues, meaning that often-times you must break things out into separate collections. This doesn't work either, though, as there are no cross-collection transactions, so if you need to break things into separate collections, you can't guarantee a write to each collection will go through properly. (Though, I suppose if you're using the latest version, you could lock your whole database)




Absolute showstopper for anything more than keeping track of simple stats or storing comments. Denormalizing has limits. Invariably apps will come to the point where you need to do joins and that is when you start cursing your decision to go with NoSQL. My experience is that NoSQL (including Mongo) is not a replacement to traditional RDBMS, but if you use NoSQL complementary to an RDBMS, primarily for real time performance, works quite beautifully. That said, there may be quite a few simple web app use cases that do not need RDBMS at all.


it's true you almost always will find yourself needing to join cross collection/table... I believe the recent support to integrate with hadoop should help this: http://www.mongodb.org/display/DOCS/Hadoop+Quick+Start when your reason for needing joins is for reporting (often the case for say financial reporting)

Also, the postgres integration (linked/discussed) here on HN


Good point; I didn't mention the lack of multi-document commits. I'll add this shortly.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: