Skip to content
About
Main content
Bytes at Rest

Persistence & Durability

When a system says "yes, your data is safe", what exactly has it promised, and what did it have to do to keep that promise?

Who this mechanism is for: a developer who writes code, calls databases and knows basic SQL, but has never studied what happens between COMMIT and the moment data is truly safe on a disk. You do not need to know what a , a , a or a is. Every technical term is explained the first time it appears, and again in the glossary at the end.

The story we will follow

Nadia is a backend engineer at Kestrel Pay, a small company that moves money between customer accounts. The core of the product is a ledger: a database that records every transfer, plus an event stream (an ordered list of "something happened" messages) that other services read. Her colleague Omar is the on-call engineer, the person who is woken up at night when something breaks.

Kestrel is about to get its first banking licence. The regulator asks one simple question: "If your server loses power at any moment, can you lose a transfer that you already confirmed to a customer?" During the audit period Nadia and Omar will meet eight problems, one at the start of each article below. Each problem looks like a bug. Each one is actually a consequence of how durability works. At the end of each article, we go back and solve the problem.

This is the main idea of this whole mechanism:

How this mechanism is organized

After that: a summary, hands-on labs, interview questions and a glossary.

One request: do not skip the numbers. This mechanism gives many small calculations (a 5 ms flush, a 20-second stall, an 80× ). The ratios are the real content.

What do I do, and what does each option cost?

Can I see it myself?

Can I reason about it under questioning?

Trade-offs

The tensions this mechanism takes a position on. Each recurs across mechanisms.

Recurring principles

Ideas this mechanism meets that keep coming back, mechanism after mechanism.

Show all 14 principles