File I/O
From bytes to data structures. Understand what happens between your code and the disk.
The Gap You Need to Bridge
You think in key-value pairs, but disks think in bytes at offsets. The OS gives you read(), write(), and seek() — that's it. This chapter shows you how to bridge that gap: encoding structures into bytes, understanding why hardware forces you to think in blocks, and why every database ends up with the same patterns.
All examples use Rust with direct OS APIs. We'll reference Linux syscalls and libc where it matters.
The Journey
Each topic solves a specific problem. By the end, you'll understand why databases are designed the way they are.
How This Connects to LSM Databases
Now you'll understand why they use blocks, why they're immutable, and why we need an index.
This is the "buffer" before flushing to disk. Batching writes for efficiency.
This is batch processing of multiple SST files. Same principles, larger scale.