mongodb - Denormalization vs Parent Referencing vs MapReduce -


i have highly normalized data model me. i'm using manual referencing storing _id , running sequential queries fetch details deepest collection.

the referencing one-way , flow has around 5-6 collections. 1 particular use case, i'm having query down deepest collection querying subsequent "_id" higher level collections. technically i'm hitting database every time run

db.collection_name.find(_id: ****).  

my prime goal optimize read without hugely affecting atomicity of other collections. have read de-normalization , not make sense me because want keep option changing cardinality down line , hence want maintain separate collection altogether.

i thinking of using mapreduce aggregation , have collection particular use-case. not sound good.

in relational db, breaking query in sub-queries , performing join data sets intersect initial results. since mongodb not support joins, i'm having tough time figuring out.

please if have faced earlier or have idea how resolve it.

denormalize data.

mongodb not join's - period.

there no operation on database gets data more 1 collection. not find(), not aggregate() , not mapreduce. when need puzzle data more 1 collection, there no other way doing on application layer. reason should organize data in way common , performance-relevant query can resolved querying single collection.

in order might have create redundancies , transitive dependencies. normal in mongodb.

when feels "dirty" you, should either accept fact performance sub-optimal or use different kind of database, classic relational database or graph database.


Comments