4 ms·
Really, in some places it hurts * We stored each show as a document in MongoDB containing all of its nested information, including cast member* I've seen this
by raverbashing 13y ago
Really, in some places it hurts
* We stored each show as a document in MongoDB containing all of its nested information, including cast member*
I've seen this in people using MongoDB and the bough the BS that because "it's a document store" there should be no link between documents.
People leave their brain at the door, swallow "best practices" without questioning and when it bites them then suddenly it's the fault of technology.
" or using references and doing joins in your application code (double ugh), when you have links between documents"
1) MongoDB offers MapReduce so you can join things inside the DB. 2) What's the problem to have links between documents? Really? Looks like another case of "best practice BS" to me
- liveoneggs 13y agoat mongo training we were told map/reduce did not offer performance and to avoid it for online use. You must use the "aggregation framework".
- lhc- 13y agoLinks in mongo aren't really links though; its up to the application to handle the "joins", which really means making an extra query for every linked item. It's like SQL joins except without any of the supporting tools or optimizations that exist in RBDMS.
- raverbashing 13y agoYes, it is manual But you can query for a list of ids for example, using the 'in' operator and a list. http://docs.mongodb.org/manual/reference/method/db.collection.find/#db.collection.find http://docs.mongodb.org/manual/reference/method/db.collectio...
- SigmundA 13y agoIsn't this done client side? Without joins in the db engine itself locality is much worse along with lost opportunities for optimization leading to much worse performance.
- mason55 13y agoYes, you have to build the list of IDs to pass to the $in operator and then send out a second query but grandparent post said you had to make an extra query for each linked item which is incorrect.
- AlisdairO 13y ago> What's the problem to have links between documents? Really? Looks like another case of "best practice BS" to me I think the main problem is that it becomes difficult to maintain consistency, due to Mongo's lack of transactions.