MongoDB stores data as flexible documents, which makes it quick to start with and a natural fit for many JavaScript and Python apps. That flexibility is also where most problems begin: without a deliberate design, collections drift, queries slow down and data ends up duplicated in ways nobody planned. This course teaches you to design MongoDB schemas around how your application reads and writes data, and to recognise when a relational database would serve you better.

What you'll learn

  • How document databases differ from relational ones, and the trade-offs involved
  • CRUD operations, query operators and projections in the MongoDB shell and drivers
  • Embedding versus referencing, and how to decide for each relationship
  • Common schema design patterns: subset, computed, bucket, extended reference and others
  • Schema validation with JSON Schema in the database, and with Mongoose in Node.js
  • Indexes: single field, compound, multikey and text, and reading query plans
  • The aggregation pipeline for reporting, grouping and joining with $lookup
  • Multi-document transactions and when you actually need them
  • Replica sets, sharding concepts and choosing a shard key
  • Backups, security basics and working with MongoDB Atlas or a self-hosted server

Who it's for

  • Node.js and Python developers using MongoDB in their apps
  • Developers inheriting a MongoDB database that has become hard to query
  • Teams deciding between a document database and a relational one

Prerequisites

  • Experience building a small app or API in JavaScript or Python (see Node.js and Express: Build REST APIs)
  • Basic understanding of JSON
  • MongoDB installed locally, in Docker or as a free cloud cluster

Outcomes

By the end of this course you will be able to:

  1. Design a MongoDB schema from an application's access patterns.
  2. Add validation and indexes so queries stay fast and data stays consistent.
  3. Write aggregation pipelines for real reporting needs.
  4. Explain when MongoDB is the right choice and when it is not.

Course outline

ModuleTopic
1Document databases and where they fit
2CRUD, query operators and projections
3Modelling relationships: embed or reference
4Schema design patterns
5Schema validation and Mongoose models
6Indexes and reading explain plans
7The aggregation pipeline
8Transactions and consistency
9Replication, sharding and shard keys
10Security, backups and operations
11Migrating and refactoring an existing schema
12Project: model and optimise a real application

FAQ

Is MongoDB schemaless?

Not in practice. The database does not force a schema, but your application always has one. The course shows how to make it explicit with validation so it does not drift.

Should I use MongoDB or PostgreSQL?

It depends on your data and queries. Highly relational data with complex reporting usually suits PostgreSQL; varied, document-shaped data often suits MongoDB. SQL and PostgreSQL Essentials covers the relational side.

Does the course use Mongoose?

Yes, for the Node.js examples, alongside the native driver so you understand what Mongoose adds.

How do I join?

Get in touch and we'll share the current format, schedule and enrolment details.