Preserve Joins by code in MongoDB

2019-07-28 03:33发布

问题:

What are the best solution to preserve left joins in a NoSQL solutions like MongoDB/Norm if you can not modify the complete architecture of one cms. Experiences, Samples, Cost.

Thanks.

回答1:

I can suggest two ways:

  1. Create big documents, i mean combine two, three, ten entites into one. So if you, for example, have reference one to many and you know that 'many' not more than 100 for most cases you can combine these entities into one.
  2. Create 'denormalized' documents with data that you need at problem places. So instead of any joins load only one document.