Learn MySQL
Interactive MySQL and InnoDB series for web app developers. Build mental models that hold under real traffic, one demo at a time.
You can ship Laravel apps for years without knowing what MySQL does with your migrations. Then one list endpoint slows to a crawl. EXPLAIN reads like tea leaves. Everyone says "add an index," but not which one, or why.
This series fixes that. Each article covers one layer of MySQL and InnoDB: column types, primary keys, indexes, query shapes, and later the engine internals. You leave with a mental model you can use in a code review the same day. Skip the static diagrams. You get small interactive demos you can poke until the idea clicks. The app examples use Eloquent, because that is what I write at my day job. The real subject is the SQL underneath. The ideas still hold when you switch ORMs.
Start at the top. Each article assumes the ones before it.
Topics
- Tables, Types & Schema for ProductionPick data types, nullability, and schema choices that keep web apps correct under real traffic.
- Primary Keys & the Clustered IndexIn InnoDB the primary key is the clustered index. Learn clustered lookups, secondary index bounce, and why random UUID primary keys hurt.
- Composite Indexes & the Leftmost PrefixBuild B-tree secondary indexes. Use composite leftmost prefix rules and measure selectivity without guesswork.
- WHERE, Projection & Sargable QueriesWrite sargable WHERE clauses and tight projections so list and detail endpoints use indexes.
More is coming. I will cover pagination that survives page 4,000, joins, transactions and isolation levels, and real EXPLAIN fluency. Then come the internals: MVCC, row locks, the buffer pool, and replication. New articles land here when they are finished.