bigonotes
System DesignDatabases

Databases

Storage engines, indexing, ACID, isolation, CAP and replication.

11 notes · 76 min total

  1. 1Core DatabasesThe four storage types almost every design uses: relational, NoSQL, blob storage and search, and when each one fits.10 min
  2. 2ACIDWhat transactions are and how atomicity, consistency, isolation and durability keep data correct through crashes and concurrency.10 min
  3. 3Isolation LevelsThe read anomalies concurrent transactions cause, the four SQL isolation levels that prevent them, and how serializable is implemented.9 min
  4. 4In-Memory vs Disk StorageHow disk-based, in-memory and LSM-based databases each use RAM and disk, and what that means for speed and data safety.5 min
  5. 5Database IndexingWhy indexes turn full table scans into fast lookups, and when to use primary, secondary, clustered, composite and covering indexes.7 min
  6. 6Hash IndexesHow hash indexes give O(1) exact-match lookups, why they can't do ranges, how collisions are handled, and when to choose them over B-trees.4 min
  7. 7Read-Heavy Indexing: B-TreesHow a B-tree finds any row in a few disk reads, how inserts and deletes keep it balanced, and why every extra index slows writes.5 min
  8. 8Write-Heavy Indexing: LSM TreesHow LSM trees turn random writes into sequential ones using a memtable, SSTables, bloom filters, compaction, tombstones and a WAL.7 min
  9. 9Indexing Trade-offsWhat every index costs in write speed and storage, when not to add one, and which engines use B-trees, LSM trees or other structures.6 min
  10. 10CAP Theorem and Consistency ModelsWhat CAP says about partitions, how eventual, strong and tunable consistency differ, and how quorums decide reads.7 min
  11. 11Replication ModelsSingle server, primary/secondary, peer-to-peer and sharding plus replication: how each spreads data and what happens on conflict.6 min