5 lessons
Query processing and join algorithms
How a SQL query actually gets executed step by step, and the three classic join algorithms — nested-loop, sort-merge, and hash join — with their worked disk-access cost comparisons.
Query optimization and execution plans
Heuristic (rule-based) optimization, cost-based optimization using statistics and selectivity, and how to actually read an EXPLAIN plan.
Distributed databases: fragmentation and replication
Why databases get split across multiple machines, horizontal/vertical fragmentation, replication strategies, and the trade-offs each introduces.
Two-phase commit and distributed transactions
How atomicity is preserved for a transaction spanning multiple machines, the two-phase commit protocol in detail, and its blocking-failure weakness.
The CAP theorem and distributed consistency trade-offs
Consistency, Availability, and Partition tolerance — why you can only fully guarantee two, and how this explains the real design choices behind relational and NoSQL systems alike.