Skip to content
About
Main content
Recurring principle

Designate one write

Atomicity over n items is atomicity over one designated item.

What it is

The same rule that guides this whole subject also applies here: atomicity over n items is implemented as atomicity over one designated item. A table format does this with one snapshot pointer. For freshness it becomes a testable claim. Freshness over n cached entries needs one designated "version cell" if the entries must agree with each other. A per-entry TTL uses no such cell. Look at six designs:

From Caching › One designated cell

All five end at the same requirement: the effect and the record of the effect must become durable together. If they do not, the ambiguity only moves down one level. This is the principle "designate one write": atomicity over n things is always built from atomicity over one thing. If you need many things to happen at once, you pick one single write (a commit record, a rename, a pointer swap) whose success makes all of them count. This article applies that principle five times in a row. The mechanisms look different, and they are not.

From Fault Tolerance & Delivery Semantics › Where 'already done' lives

The single most useful saga rule is "atomicity over n items is atomicity over one item" in disguise. Put the irreversible step at the end. If the step that cannot be undone happens last, it becomes the designated event that decides whether everything before it counts. You have recovered a commit point by construction instead of by protocol. Where that is impossible, defer the irreversible effect (hold the email; authorize the card payment but do not settle it) until a point that can serve as the commit.

From Transactions & Concurrency Control › Sagas

Where it appears

In 13 mechanisms. Each says what the mechanism is about, then how this principle shows up there, in its own words.

Made on the same pages most often.