From the course: Data Modeling in MongoDB

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Embedding vs. references

Embedding vs. references - MongoDB Tutorial

From the course: Data Modeling in MongoDB

Embedding vs. references

- [Instructor] By now we've seen multiple ways to hydrate our document using both embedded sub documents and objects as well as with remote references. In this lesson, we'll examine some of the pros and cons of each approach and get into a few of the best practices. So, now we know a couple of ways to model relationships. On one hand, we have the option to do some complex linking between using reference fields and query through a joint-like syntax. And alternatively, we can use embedded data potentially duplicated from a master source in a single document. Which one is best? Which should we choose? Well, your use cases will ultimately help make that decision for you, but let's work through some of the questions you'll want to be asking and answering as of this process. Here are some of the key questions that should be driving our decision. The answers to which of course will point you in other directions. How big is my…

Contents