From the course: Data Modeling in MongoDB

Unlock the full course today

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

Query-first modeling

Query-first modeling

- [Instructor] Query first design is really the notion of knowing our core data requirements and making a single query to fetch the document that we need for the application. Once we have a basic understanding of the application structure, you're then able to parse it out and begin designing the full page model. And as always, we continue to ask the core questions as we go. What data do I need? Where does that fit in with the rest of the visible page? Now, the goal here is to make one query, one document that we can fetch with a all of one lookup from our database that has everything we need to deliver the proper content of the page. That's a lofty goal, but let's start there anyway. To recap, here's our use case. We're building a social media application where we have users, users being connected to one another, users making new posts, posts which have titles, content, media, singular reactions which are…

Contents