MongoDB

roadmap.sh: https://roadmap.sh/mongodb

Suggested path through the MongoDB nodes. Each node links to its lesson when written.

Nodes

Introduction

  • What is MongoDB?
  • SQL vs NoSQL
  • Document Databases
  • When to Use MongoDB
  • MongoDB Editions (Community, Enterprise, Atlas)
  • BSON vs JSON
  • Installation and Setup

Core Concepts

  • Databases
  • Collections
  • Documents
  • Fields and Data Types
  • _id and ObjectId
  • Embedded Documents
  • References
  • Capped Collections

MongoDB Shell & Tools

  • mongosh
  • MongoDB Compass
  • mongoimport / mongoexport
  • mongodump / mongorestore
  • MongoDB for VS Code
  • Database Drivers

CRUD Operations

  • insertOne / insertMany
  • find and findOne
  • Query Operators (Comparison, Logical)
  • Element and Evaluation Operators
  • Projection
  • updateOne / updateMany
  • Update Operators (inc, $push, etc.)
  • replaceOne
  • deleteOne / deleteMany
  • Bulk Write Operations
  • Cursors

Querying

  • Querying Embedded Documents
  • Querying Arrays
  • Array Operators (all, $size)
  • Sorting
  • Limiting and Skipping
  • Counting Documents
  • Distinct Values
  • Regular Expressions

Aggregation Framework

  • Aggregation Pipeline Concept
  • $match
  • $group
  • $project
  • limit / $skip
  • $lookup (Joins)
  • $unwind
  • set
  • $facet
  • bucketAuto
  • Accumulator Operators
  • merge
  • Map-Reduce

Indexing

  • Index Concepts
  • Single Field Indexes
  • Compound Indexes
  • Multikey Indexes
  • Text Indexes
  • Geospatial Indexes
  • Hashed Indexes
  • Wildcard Indexes
  • TTL Indexes
  • Partial and Sparse Indexes
  • Unique Indexes
  • explain() and Index Usage
  • Covered Queries

Data Modeling

  • Schema Design Principles
  • Embedding vs Referencing
  • One-to-One Relationships
  • One-to-Many Relationships
  • Many-to-Many Relationships
  • Schema Design Patterns (Bucket, Outlier, Computed)
  • Anti-Patterns
  • Schema Validation

Transactions

  • ACID in MongoDB
  • Single Document Atomicity
  • Multi-Document Transactions
  • Sessions
  • Read and Write Concerns
  • Read Preferences

Replication

  • Replica Set Concepts
  • Primary and Secondary Nodes
  • Arbiter
  • Elections and Failover
  • Oplog
  • Replica Set Configuration
  • Write Concern and Replication

Sharding

  • Sharding Concepts
  • Shard Keys
  • Chunks and Balancing
  • Ranged vs Hashed Sharding
  • Config Servers
  • mongos Router
  • Zone Sharding

Performance

  • Query Optimization
  • Index Optimization
  • Profiler and Slow Queries
  • Working Set and Memory
  • Connection Pooling
  • Aggregation Performance

Security

  • Authentication (SCRAM, x.509, LDAP)
  • Role-Based Access Control
  • Built-in and Custom Roles
  • Network Security and IP Allowlists
  • TLS/SSL Encryption
  • Encryption at Rest
  • Field Level Encryption
  • Auditing

Administration & Deployment

  • Backup and Restore Strategies
  • Monitoring (mongostat, mongotop)
  • MongoDB Atlas
  • Atlas Search
  • Change Streams
  • GridFS
  • Logging
  • Deployment Topologies
  • Upgrades and Maintenance

Resources

See resources.md.

Project ideas

  • Design and build a blog or e-commerce data model that demonstrates embedding vs referencing trade-offs, then add schema validation rules to enforce it.
  • Write an analytics aggregation pipeline over a real dataset using group, facet, and tune it with compound and covered indexes.
  • Deploy a 3-node replica set locally (or on Atlas), simulate a primary failover, and use Change Streams to drive a real-time event consumer.

1 item under this folder.