Cruxly

Cruxly › System design › Principles of Distributed Design

Truth Has One Home

for every fact, name the single component that owns it — everything else holds a copy

Open the interactive lesson

The principle: every fact in a distributed system should have exactly one authoritative owner. Every other place that fact appears is a derived copy, and must be treated as possibly stale. Two components that both believe they own the same fact will eventually disagree, and there will be no principled way to resolve it.

Copies are fine — they are how systems get fast. What is not fine is ambiguity about which copy is the truth.

The violation: two owners for one fact

This mistake hides inside designs that look well-factored.

Inventory service   → stores stock_count per product  (authoritative?)
Search index        → stores stock_count for filtering (authoritative?)
Cart service        → decrements its own stock_count on add-to-cart (!)

The fix: one writer, many readers, and an explicit propagation path

Inventory service  → SOLE owner of stock_count. All mutations go here.
Search index       → derived copy, read-only, updated via change events
Cart service       → holds a RESERVATION (its own fact, which it does own),
                     and asks inventory to decrement

Propagation: inventory emits StockChanged → index and caches consume it

Where this principle is hardest: caches, and the reason invalidation is difficult

The three strategies, each conceding something different:

:::key The connection back to the principle Every one of these strategies is an answer to the same question: how does a derived copy learn that the truth moved? Framing invalidation this way is what makes it tractable, rather than the folk wisdom that it is simply one of the two hard problems. :::

How to say it in the interview

"For each piece of data here I want to name which component is the authority and which are holding derived copies, because the failure mode I am trying to avoid is two places that both think they are right — at that point reconciliation is guesswork, and guessing about money or inventory is how you end up with an incident that has no clean fix."

Checklist

Practice this interactively
Share this lessonWhatsAppLinkedInX

Related lessons