Software Engineering Architecture Lab

Database Internals Lab: Interactive Simulations & Lessons

Storage engines, indexes, replication and partitioning. A hands-on database internals lab with 6 interactive simulations and 5 lessons.

Storage engines, indexes, replication and partitioning.

What happens between INSERT and the disk, why an index can make a query 1,000× faster and writes slower, how copies of data drift apart, and how data is split across machines.

Simulations

  • B-Tree vs LSM-Tree — Insert keys into both engines side by side and watch page splits, memtable flushes, SSTables and compaction happen.
  • Database Index — Query 10,000 ShopFlow orders with and without an index; count rows examined and see write costs rise.
  • Leader/Follower Replication & Failover — Write to a leader, switch sync/async replication, kill the leader, and see what failover loses.
  • Replication Lag: Read-Your-Writes — Update your profile, read from a lagging replica, and fix it with read-your-writes and monotonic-read strategies.
  • Hash vs Range Partitioning & Hotspots — Distribute orders by range and by hash, then simulate a celebrity seller and watch a hot partition form.
  • Consistent Hashing Ring — Place keys on a hash ring, add or remove servers, toggle virtual nodes, and compare key movement with modulo hashing.

Lessons

  1. Storage Engines: B-Trees vs LSM-Trees — Level 8 · Data Systems
  2. Indexes: Fast Reads, Slower Writes — Level 8 · Data Systems
  3. Replication: Leaders, Followers & Failover — Level 8 · Data Systems
  4. Replication Lag: When Your Own Write Disappears — Level 8 · Data Systems
  5. Partitioning: Hash, Range, Hotspots & Rebalancing — Level 8 · Data Systems

Also explore

Other labs

  • Kafka Lab — Logs, partitions, keys, consumer groups and ordering.
  • Transactions Lab — Isolation anomalies, lost updates and distributed transactions.
  • Caching Lab — Hit rates, TTLs, invalidation, stampedes and CDNs.
  • Microservices Lab — Failures, retries, circuit breakers, sagas and idempotency.
  • Architecture Lab — Evolution, decisions, characteristics and fitness functions.