MongoDB & NoSQL
The decision, not the syntax
Documents, and the one choice that decides whether a schema survives a year of traffic: nest it, or point at it. Four modules on what a filter matches, what a copied fact costs, what a pipeline returns and which index a query can use — then a real shell, 24 real orders, and the module nobody teaches this with.
- Modules
- 5
- Drills
- 9
- Build steps
- 7
- Time
- ~4h
Walk out able to
Turn an access pattern and a growth rate into the embed-or-reference decision they already determine — and name the workloads you would not put here at all.
What you drill
Filters that mean it
Dotted paths, arrays, and a key that is absent.
Embed or reference
Growth, write fan-out, and which end holds the pointer.
Pipelines, stage by stage
What each stage receives, and what unwind does to it.
When not to use it
Four boundaries, and the one that is your own schema.
The pitch
What you practise, and what you leave with
A shell with a 24-order collection in it, four questions answered with pipelines you wrote, and a schema decision defended with a number.
You will practise
- Filters: dotted paths, arrays, absent keys
- Embed or reference, priced in writes and days
- Pipelines: what each stage receives
- Index order, and writing the line that does it
Afterwards you can
- Decide embed or reference from the facts
- Say what a pipeline returns before running it
- Order a compound index for a query and a sort
- Name a workload you would not put here
Modules
5 modules, 32 items
Lessons explain one idea. Drills repeat it until it sticks. Build steps make something that exists afterwards.
- 1
A document, and what it costs
~34 minRead a document with arrays and subdocuments in it, and say what a filter matches.
- LessonWhy a document instead of a row4 min
- LessonRead a document before you query it9 min
- LessonWhat a missing key means6 min
- LessonThe ceiling is a schedule5 min
- DrillCount what the filter returns10 min
- 2
Embed it or point at it
~50 minTurn an access pattern and a growth rate into the decision they already determine.
- LessonFix the access pattern first9 min
- LessonWhat one document buys you6 min
- LessonWhich end holds the pointer6 min
- DrillDecide embed or reference11 min
- DrillPrice the copy in writes9 min
- DrillGrow the array until it breaks9 min
- 3
Trace a pipeline, stage by stage
~42 minSay how many documents reach each stage of a pipeline, and what the last one emits.
- LessonA pipeline is a fold, not a query7 min
- LessonThe stage that grows the stream6 min
- LessonDocuments that were never there8 min
- DrillCount what comes out12 min
- DrillValue one group9 min
- 4
Make the query use an index
~31 minOrder a compound index for a given filter and sort, and say which queries it serves.
- LessonAn index is ordered, not a set7 min
- LessonEquality, sort, range — in that order8 min
- LessonNever touching a document at all6 min
- DrillPick the index that works10 min
- 5
When not to use it
~2hName the workloads this is wrong for, get the spelling right, then use a real shell.
- LessonAn invariant across two documents7 min
- LessonThe questions nobody shaped for7 min
- LessonThe one that is not its fault6 min
- DrillName what breaks10 min
- DrillWrite the line that does it10 min
- Build stepGet a shell and a collection7 min
- Build stepRead one order, count every line6 min
- Build stepFan out one channel7 min
- Build stepTotal one channel9 min
- Build stepFind the biggest customer13 min
- Build stepPrice the copy you are carrying8 min
- Build stepThe one you would not ship7 min
More in Data & databases
Keep going
SQL: Queries
Say what a query returns before you run it.
Intermediate~3h6 modules
ORMs
Count the queries before the mapper sends them.
Intermediate~4h6 modules
SQL: Joins & NULL
The rows that found no partner, and the values that are not there.
Advanced~4h5 modules
SQL: Advanced
The clause you did not write decided the number.
Advanced~6h7 modules
Embed it or point at it — and know which, with a number.
The first item is free. ~4h of focused work, at your own pace.
Advanced~4h5 modules