13.6 · Crashes mid-write, integrity, backups and data protection

The app can be killed at any instruction. Persistence is only correct if every write leaves the data valid whenever it stops.

Mental model. Assume power loss between any two lines. Make each change either fully applied or not at all, and never trust what you read back.

Survival

Atomic writes, journaling, backups and file protection.

  1. How do you protect data from crashes mid-write, corruption and backups: atomic writes, journaling, exclusion from backup and data protection? 13.6.1 · L5
    A write that is interrupted halfway leaves a torn file: part new, part old, often unreadable. The universal fix is write somewhere else, then swap. For files…

More in Persistence & data