Databases
Where truth lives, and why it's usually the first thing to break.
SQLPostgreSQLprimary keysforeign keysindexestransactionsACIDjoinsnormalizationlockingdeadlocksconnection poolingNoSQLRedissearch engines
Lessons
- 4.1SQL and relations: modelling a hotel in tablesHow a hotel's guests, rooms and bookings fit into tables that point at each other, and why that saves you from a whole family of bugs. 30 min
- 4.2Indexes: from 500 ms to 10 msWhy one small change can make a slow page 50 times faster, and why you shouldn't make that change everywhere. 30 min Index visualizer
- 4.3Transactions and ACID: never double-book the last roomTwo guests click Book on the last room at the same instant. Here's what the database promises, and the gap where double bookings sneak in. 30 min
- 4.4Locking and deadlocksWhen two people change the same thing at once, someone has to wait. Here's how databases take turns, and how they get stuck. 30 min
- 4.5The NoSQL landscape"NoSQL" isn't one thing. It's a toolbox of databases, each brilliant at one kind of question. Here's how to pick without the hype. 30 min Sharding simulator
- 4.6Connection poolingWhy your app keeps a few database connections open and shares them, and why adding more connections often makes things slower. 30 min
On the job: try it on your own project
Ask Claude Code to draw your main tables and their relations, then to find the three slowest or most frequent queries (from logs or by reading the code) and check which indexes they use. On a branch or a copy, never production, let it run EXPLAIN on them. Write down one index or query change you would ship, with the expected gain and the risk.
Can you do this now?
0/4. Anything you can't tick yet: reopen that lesson's practice ladder.