3 ms·
>The problem is that at some point you end up wanting joins. It can join with the $lookup function these days. Although it is only to a "non-sharded collection
by 198394549 8y ago
>The problem is that at some point you end up wanting joins.
It can join with the $lookup function these days. Although it is only to a "non-sharded collection". I don't know why it can't join to a sharded collection when the join is on the same shard though.
There is also the option of using $in with a list of things you have pulled down in another query.
Then there are client-side joins.
- naranha 8y ago> Then there are client-side joins. AKA what you are doing when writing your SPAs with their own state management. Server-side joins rarely make sense in that context. For reporting/analytics.. yes. But these can be delegated to external system/databases optimized for that task. With elasticsearch for example you get very far very quickly without the need to write any SQL joins.
- dvlsg 8y agoWould you suggest elasticsearch over sql for analytics like these? We're actually looking at a very similar situation, and I have a hard time believing aggregations in elasticsearch (especially when no full text indexes are required) are a better fit than sql. That could be my lack of experience with elastic though.