3 ms·
This part is totally misguided. > What’s missing from MongoDB is a SQL-style join operation, which is the ability to write one query that mashes together the a
by karmakaze 6y ago
This part is totally misguided.
> What’s missing from MongoDB is a SQL-style join operation, which is the ability to write one query that mashes together the activity stream and all the users that the stream references. Because MongoDB doesn’t have this ability, you end up manually doing that mashup in your application code, instead.
Even with a normalized relational database one wouldn't make a single query to return rows from a join of tables T1, T2, T3, etc when there are repeating relations such as the users in the social graph. This might be done sometimes paying for the duplication to save a network round trip, that's all and no different.
- debaserab2 6y agoA list of activities joined to users wouldn't be a problem for an RDBMS. I'm not sure what you mean by "repeating relations".
- karmakaze 6y agoThe deep relations (7-table join) example in the link is something I wouldn't do (including the repeated 'user' entities) with an RDBMS, given that I expect some elements of some tables to appear multiple times, that's a waste of I/O and hard to cache. > Users have friends, friends have posts, posts have comments and likes, each comment has one commenter and each like has one liker. I would likely gather all the instances of User id in each context (user, friend, commenter, and liker) and query it separately from the JOIN query. Depends on your data which way works out better on average/worst-cases.