Data modeling issue - Application and Runs

Hello everyone,

So here is the issue:
We have two collection : Applications and Runs, and each Run document represents an execution of a specific Application (also a document).

Our UI lets users filter the Runs and next to each run we wish to show the application name, and application labels. e.g. Run number 1234 app_name: “hello_world_app” app_labels: [‘latests’ ,‘test’].

My problem is that Mongo is slow at “joins” (lookups) so referencing an external applciation is not an option, therfore I have to keep application info embeded in the Run document - the downside of this approach is that applications may be renamed, but usually it’s labels are being editited, so emeddeing will keep an “old” version of that application.

I will be very happy to get an idea. (by the way just finished the M320 online course)

If you have the appropriate indexes the following is not usually an issue.

I am not too sure about the use cases but I would believe that the embedded document is best. I would not like to see an old Run with the new Application name. Keeping the historical name might be better. Also if the renaming is not so frequent, you might update both collections to keep things in sync.