Skip to content
Ship Like Crazy
Map›Part III · Data🪔 Day 19 / 30⏱ ~90 min🔒 Full book

Chapter 9. The Diwali Dress Rehearsal

Database design that stays fast: schemas, indexes, N+1

Act III · The Rush · with Tiku

Chapter title card with the chapter's host character and the day of the countdown.

What you'll learn in this chapter

  • Design a data model before building features, and ask Claude for a good one
  • Apply the core rules: one fact in one place, keys, the right types, owner columns
  • Find and fix the four classic slowdowns: missing indexes, N+1 queries, loading everything, slow RLS
  • Read a simple EXPLAIN plan and measure before and after
  • Sketch a multi-tenant schema so QueueLess can serve more than one café

Inside

  1. Schema first, features second
  2. The rules of a tidy pantry
  3. Why the rehearsal collapsed: four slowdowns
  4. One app, many cafés: multi-tenant design
  5. Growing up: habits for a database with real customers
  6. Your turn: survive the rehearsal rerun
  7. What you've learned
Checking your ticket at the door…