databases
5 lessons tagged databases: free, quiz-checked micro-lessons.
Database Sharding and Replication
Go beyond a single database: learn how read replicas offload query load, how range and hash sharding partition data, why consistent hashing makes rebalancing tractable, and how to pick a shard key that avoids the celebrity problem and cross-shard pain.
Transactions, Isolation, and MVCC
Transactions are a promise. Learn the ACID guarantees, the exact anomalies each SQL isolation level prevents or allows, why two-phase locking blocks and MVCC does not, and how Postgres uses row versions plus a transaction ID visibility check to give you snapshot isolation without holding a single read lock.
Storage Engines and Page Layout
Disk geometry dictates database design. Learn why sequential I/O beats random I/O by 100x, how fixed-size pages and slotted page headers work, why row-stores and column-stores suit different workloads, how the buffer pool keeps hot pages in RAM, and how the write-ahead log makes durability cheap.
LSM-Trees and Write-Optimized Storage
B-trees rule read-heavy OLTP; LSM-trees rule write-heavy workloads. Learn how the memtable and immutable SSTable pipeline converts random writes into sequential I/O, why compaction is unavoidable, how bloom filters slash unnecessary reads, and when to pick LSM over B-tree.
B-Tree Indexes
B+ trees are the workhorse of relational databases. Learn why their high fanout and shallow depth match disk perfectly, how point lookups and range scans work, the difference between clustered and secondary indexes, how covering indexes eliminate table lookups, and the hidden write cost of keeping indexes up to date.
