Skip to contentSkip to content

Part 1: Foundations

"You cannot optimize what you do not understand. You cannot understand what you have not built."

Overview

Four chapters that cover everything a database engineer needs before touching production:

#ChapterCore ConceptDifficulty
01The Database LandscapeCategories, storage engines, WALBeginner
02Data Modeling for ScaleAccess-pattern-driven schema designIntermediate
03Indexing StrategiesB-tree, composite, GIN, partial indexesIntermediate
04Transactions & Concurrency ControlACID, MVCC, isolation levels, lockingAdvanced

Key Themes

  • Storage before queries — how data lands on disk before you can query it
  • Access patterns first — design your schema around how you read, not how you think
  • Indexes are not free — every index costs write amplification and storage
  • Isolation is a spectrum — READ COMMITTED, REPEATABLE READ, and SERIALIZABLE trade correctness for throughput

What You'll Be Able to Do

After completing Part 1 you will be able to:

  • Explain why PostgreSQL uses a WAL and what happens during a crash recovery
  • Design a schema for a social media application that avoids the most common N+1 query traps
  • Choose between a B-tree, GIN, partial, and expression index for a given query
  • Explain the difference between lost updates, phantom reads, and write skew — and which isolation level prevents each
  • Implement optimistic concurrency control with a version column

Continue to Part 2

After finishing these four chapters, continue to Part 2 — Engine Deep Dives to go inside PostgreSQL and MySQL.

Comments powered by Giscus. Enable GitHub Discussions on the repo to activate.

Built with VitePress + Dracula Theme