# Second pass: deepening each phase (Lessons 8–15)

First pass (1–7) closed the curriculum order at survey depth. This second pass goes one level down inside each phase, same order: Postgres internals → networking → OS → Python → distributed systems. Rationale: the mission prizes depth-per-hour over breadth, and each new lesson deepens a mechanism the first pass only referenced.

## What was added, and why

| # | Lesson | Deepens | Why this topic |
|---|--------|---------|----------------|
| 8 | MVCC and vacuum | Lesson 2's snapshot model → physical storage | Explains the "grows over time" signature precisely; distinguishes disk bloat (restart doesn't fix) from in-memory leaks (restart does fix) |
| 9 | Planner and EXPLAIN ANALYZE | Lesson 1's index rules → cost model | Direct mission success criterion: reads a plan, explains the choice, knows when stats — not indexes — are the fix |
| 10 | TCP congestion control | Lesson 4's RTT → behavior under load | The "p99 explodes while CPU is flat" signature; bufferbloat; why connection reuse buys cwnd, not just handshakes |
| 11 | Virtual memory and page cache | Lesson 5's processes/threads → memory | The leak vs. page-cache distinction; RSS/VSZ; OOM; swap — the other "degrades over hours" root cause |
| 12 | asyncio event loop | Lesson 6's asyncio row → the mechanism | Resolves Lesson 5's epoll pointer; the blocking-call-freezes-everything production bug |
| 13 | Backpressure and load shedding | Lesson 7's retries → overload response | Mission explicitly names backpressure; the unbounded queue as delayed, amplified failure (Little's law) |
| 14 | Idempotency | Lesson 7's flagged forward-pointer | Makes retries on writes safe; effectively-once; key store design and its classic bugs |
| 15 | Replication and consistency | Lesson 7's CAP forward-pointer | Leader-based replication, lag anomalies, async durability window, failover data loss |

## Structure decisions

- Each lesson keeps the established contract: scenario-driven, one self-check quiz, hands-on exercise, primary sources, prev/next/reference nav.
- Nav links now run linearly through the pass (8→15); each still links its cheat sheet (transactions, indexing, networking, OS, concurrency, distributed-systems).
- Lesson 7's nav was re-pointed from "end of curriculum" to Lesson 8.
- No new reference cheat sheets: each new lesson pairs with an existing one, so the reference files stay the single source of truth per topic.

## Follow-ups left open (deliberately not covered)

- Consensus/quorum replication (Raft, etc.) — flagged as forward pointer in Lesson 15; MIT 6.824 when fundamentals are set.
- Multi-leader conflict resolution — same forward pointer.
- Partitioning/sharding — third leg of DDIA's replication/partitioning/consensus triad, not yet covered.
- If any second-pass lesson lands flat, revisit; the mission's test-first preference means these should get validated with hands-on exercises, not just reading.
