MongoDB
Here's how I got my head around MongoDB — not just how to call it, but what it's actually doing underneath. I'm just sharing the way I wish it had been explained to me. If you know JSON, you're already halfway there. By the end of this topic you'll be able to explain what happens on disk when you insert a document and create an index, and that's the kind of understanding that separates someone who uses a database from someone who understands one.
I turned these notes into a NotebookLM notebook so you can ask MongoDB anything, get audio overviews, and explore at your own pace.
Notebook link coming soon.The one-sentence version
MongoDB is a document database: instead of tables and rows, it stores documents that look like JSON objects, grouped into collections.
That's the whole mental model. Everything else is detail layered on top.
Where it actually shows up
This isn't academic — MongoDB runs real products at scale:
- eBay, Forbes, Adobe use it for content and catalog data that changes shape often.
- Real-time analytics & IoT pipelines lean on it because documents map naturally to events.
- It's the "M" / default database in countless startups and the MEAN/MERN stack from the JavaScript ecosystem.
It shines when your data is document-shaped (read and written together as a unit) and your schema evolves quickly — exactly the situation a fast-moving app is usually in.
How I've broken this topic down
I kept each page short but deep. Read them in order:
| # | Page | What you'll understand |
|---|---|---|
| 1 | The Mental Model | Documents, collections, _id, and why the model clicks fast if you know JavaScript |
| 2 | How It Stores Data | BSON on disk + the WiredTiger storage engine (cache, journaling, MVCC) |
| 3 | Indexing | Why a query is fast or slow — the B-tree behind every index |
| 4 | Querying & Aggregation | CRUD, the operator + update toolbox, and the aggregation pipeline |
| 5 | Data Modeling | The big decision: embed vs. reference, and the patterns that follow |
| 6 | Scaling | Replica sets, sharding, and change streams — surviving failure and growing |
| 7 | Transactions & Consistency | Atomicity, multi-doc ACID transactions, read/write concern, causal consistency |
| 8 | Operating MongoDB | Time-series & capped collections, security, search, connection pooling |
Let's start with the mental model. 👉 The Mental Model