Data Modeling in MongoDB
3hIntermediate2025-03-04
Authors
John Cokos
Director of Curriculum at Code Fellows
Course details
MongoDB is a leading noSQL database that stores data in documents or collections, which is very different from the relational or SQL databases that most data developers are familiar with. In this course, instructor John Cokos explores ways to use MongoDB at scale with complex data modeling techniques and cloud deployments. As a means of demonstrating the complexities of modeling real-world data with MongoDB, John works through the process of setting up an application resembling a social media website, and shows you how to model frequently used, deeply nested, and shared data sources to support an enterprise-level application. John also presents a series of challenges and solutions, so you can test your learning along the way.
Skills covered
MongoDBData ModelingDatabase DevelopmentDatabase ManagementData ScienceOpen SourceSoftware DevelopmentOne-Off
Concepts
0. Introduction
- 01 - Introduction to data modeling
- 02 - Prerequisites
- 03 - The problem domain - Social media project
MongoDB Modeling Basics
- 04 - Mongo ERD vs. SQL
- 05 - Application-driven architecture
- 06 - Query-first modeling
- 07 - Challenge - Create the golden model object for an online retailer
- 08 - Solution
Complex Modeling
- 09 - Embedded documents as subdocuments
- 10 - Summary and partial documents
- 11 - One-to-one relationships
- 12 - One-to-many relationships with embedded documents
- 13 - One-to-many relationships with back references
- 14 - Many-to-many relationships
- 15 - Challenge - Create the proper relationships and summary documents for an online store
- 16 - Solution
Implementation Tools
- 17 - Schema versioning
- 18 - JSON Schema
- 19 - Modeling tools
- 20 - ORMs
- 21 - Challenge - Create a schema in a visual tool and in Mongoose
- 22 - Solution
- 23 - Using Copilot for business modeling
- 24 - Working with an AI CoPilot to fine-tune your schema
- 25 - Challenge - Create a schema with AI CoPilot
Best Practices
- 26 - Embedding vs. references
- 27 - Optimization - Antipatterns
- 28 - Optimization - Best practices