System design / 4 simulations
Database Internals for System Design
Database internals you can see: B-tree vs LSM tree, the write-ahead log and fsync, MVCC snapshots and vacuum, and row vs column stores.
Open the lab → Change the load, break a part, watch what happens. Free, no sign-up.
What happens inside the database
Most system design answers say put it in Postgres or use Cassandra and move on. Knowing what the database does with each write explains why: a B-tree rewrites pages in place and suits read-heavy apps, while an LSM tree turns writes into sequential files and suits heavy write loads such as logs, metrics and chat.
Durability comes from the write-ahead log. A commit is safe only once its log record is on disk, and how often the database forces that (every commit, in groups, or once a second) is a direct trade between speed and how much data a power cut can lose. MVCC lets long reports and constant writes run together by keeping old row versions, at the cost of cleanup work.
Finally, layout decides which queries are cheap. Row stores fetch one whole record fast; column stores scan a few columns over billions of rows. The simulations below show each of these trades with numbers you can change, ending with how the planner picks an index.
All topics: database internals
- B-tree vs LSM tree: how databases store rows on diskIntermediate · 5 min
Slide the write share and compare a B-tree with an LSM tree: random page writes vs sequential files, compaction levels and Bloom filters.
- Write-ahead log: fsync, group commit and crash recoveryIntermediate · 5 min
Commit with an fsync each time, share fsyncs with group commit, or go async, then pull the power cord and see which commits survive.
- MVCC: snapshots, locks and table bloatAdvanced · 5 min
Run a long report while orders arrive. Read locks make writers wait; MVCC snapshots let both run but keep old row versions until vacuum.
- Row store vs column store: OLTP vs analytics queriesBeginner · 5 min
The same table stored by row and by column. Load one order or sum revenue over 100 million rows and see how many bytes each layout reads.
Other topics
- System Design Basics
- Scaling Databases and Caches
- Queues, Kafka and Streaming
- Reliability and API Gateways
- Security and Authentication for System Design
- Testing and Reliability for System Design
- Networking and API Design for System Design
- Distributed Systems Patterns for System Design
- Data Platform and Data Engineering for System Design
- Observability for System Design
- DevOps and Cloud Infrastructure
- Payment System Design
- System Design Interview Questions