Skill Roadmap

MongoDB

MongoDB is the document database behind countless backend APIs — combining a flexible, JSON-like schema with built-in horizontal scaling. This roadmap walks you from the core data model through CRUD, query operators, indexing, aggregation pipelines, and on to scaling and securing a production deployment.

MongoDB or PostgreSQL?

Neither is inherently better — it depends on the shape of your data

Both MongoDB and PostgreSQL have a strong case to make. MongoDB combines a document-based data model, flexible schema design, and built-in support for horizontal scaling. PostgreSQL combines a mature relational data model, powerful querying capabilities, and the reliability that has made it a popular choice for decades.

Neither is inherently better than the other, which is why the decision isn't straightforward — and why it's important to get it right from the beginning. Reach for MongoDB when your data is naturally document-shaped, your schema will evolve quickly, or you need to scale reads and writes horizontally across a cluster.

MongoDB Atlas is the fully-managed, cloud-hosted version of MongoDB — it handles provisioning, backups, scaling, and security so teams can run a cluster without managing the servers themselves.

The MongoDB Roadmap

Work through these in order, from the data model to running a cluster in production

STEP 1
MongoDB logo

MongoDB Basics

What MongoDB is, how it compares to relational databases, and when to reach for it.

SQL vs NoSQL What is MongoDB? When to use MongoDB? MongoDB Atlas
STEP 2

Data Model & Data Types

How documents are structured and stored — the foundation everything else builds on.

MongoDB Terminology BSON vs JSON Embedded Objects & Arrays
BSON Data Types
Double String Array Object Binary Data Undefined Object ID Boolean Date Null Regular Expression JavaScript Symbol Int32 / Int Int64 / Long Timestamp Decimal128 Min Key Max Key
STEP 3

Collections & Methods

The core CRUD operations you'll reach for on nearly every collection.

Counting Documents insert() find() update() delete() bulkWrite() validate()
STEP 4

Read / Write Concerns & Useful Concepts

Control durability and consistency guarantees, and work safely with large result sets.

Read Concerns Write Concerns Cursors Retryable Reads / Writes
STEP 5

Query Operators

Shape, filter, and match documents precisely — the vocabulary behind every find().

Projection Operators
$project $include $exclude $slice
Comparison Operators
$eq $gt $lt $gte $lte $ne $in $nin
Array Operators
$all $elemMatch $size
Element Operators
$exists $type $regex
Logical Operators
$and $or $not $nor
STEP 6

Performance Optimization

Index the right fields and shape queries so they scale with your data.

Creating Indexes
Single Field Compound Text Expiring (TTL) Geospatial Atlas Search Indexes
Query Optimization
STEP 7

Aggregation

Chain stages together to reshape, summarize, and join data across collections.

Common Operators
$match $group $sort $project $skip $limit $unwind $lookup $sum
Pipelines, Stages & Operators Transactions
STEP 8

Developer Tools

Connect MongoDB to the wider data ecosystem and keep it recoverable.

MongoDB Connectors
Kafka Spark Elastic Search
Backup & Recovery
mongodump mongorestore
Language Drivers
STEP 9

Scaling MongoDB

Move from a single node to a resilient, horizontally-scaled cluster.

Replicasets Sharded Clusters Tuning Configuration Indexing Query Optimization
STEP 10

MongoDB Security

Lock down access and protect data in transit and at rest.

Role-based Access Control X.509 Certificate Auth Kerberos Authentication LDAP Proxy Auth MongoDB Audit
Encryption
Encryption at Rest Queryable Encryption Client-Side Field Level TLS / SSL Encryption

GitHub Projects

Real, buildable projects to put on your own GitHub

Frequently Asked Questions

Common questions from people starting out with MongoDB

Which is better: MongoDB or PostgreSQL?

Both have a strong case to make. MongoDB combines a document-based data model, flexible schema design, and built-in horizontal scaling, while PostgreSQL offers a mature relational model, powerful querying, and decades of proven reliability. Neither is inherently better — the right choice depends on how your data is shaped and how it needs to scale.

When should I use MongoDB?

MongoDB fits well when your data is naturally document-shaped (nested, variable, or evolving quickly), when you need to scale horizontally across many servers, or when rapid iteration on the schema matters more than strict relational guarantees.

What is MongoDB Atlas?

Atlas is MongoDB's fully-managed, cloud-hosted database service. It handles provisioning, scaling, backups, and much of the security configuration, so teams can run a production cluster without operating the underlying servers themselves.

What's the difference between BSON and JSON?

BSON is the binary-encoded format MongoDB actually stores documents in. It's built on the same structure as JSON but adds extra data types — like ObjectId, Date, and Decimal128 — plus more efficient encoding and traversal than plain text JSON.

Does MongoDB support transactions?

Yes. Multi-document ACID transactions are supported across replica sets and sharded clusters, which lets you group several read and write operations so they either all succeed or all roll back together.

How do I scale MongoDB for production?

Replica sets give you redundancy and automatic failover, while sharded clusters distribute data horizontally across multiple servers as your dataset or throughput grows. Most production deployments combine both, alongside careful index and query tuning.

Track complete

From documents and BSON types to indexing, aggregation, and a sharded cluster — that's the core of what's expected of anyone running MongoDB in production. Keep building, and pair it with a backend framework to put it to work in a real API.

Where next?

Keep exploring by domain or drill into a single skill