⚡ Zig Guide LiveUnofficialbut fully verified
✓ Zig 0.17.0-dev.1516+8a4b5424dWhat's newOn an older Zig?

Data and Storage

Every database is a file, plus the rules that keep it honest when two things touch it at once and when the power goes out. These chapters build those rules from nothing: append-only records, a lock, an index, and a log written before the change it describes.

  1. An append-only file cannot delete. Removal is a record you add, which is why every log-structured store has tombstones.
  2. Read, modify, write is three steps, and the gap between the first and the third is where the other writer gets in.
  3. A race gives a different answer every run. That is what makes it expensive to find, not what makes it rare.
  4. An index does not make the data smaller. It adds a second structure you now have to keep in step with the first.

5 chapters.