Caffeinated Coder
Book an appointment
Lesson 42 · Web and backend

Indexes and transactions

Two ideas make databases both fast and safe. An index lets the database jump to the rows you want instead of reading every one, at the cost of extra space and slower writes. A transaction groups several changes so they all happen or none do. Watch a query scan a table, then walk a B-tree straight to its row, and watch a bank transfer crash halfway, get rolled back, and finally commit.

12 min12 steps5 questionsBeginner
Fig 42 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.