open atlas
↑ Back to track
System Design Case Studies SDC · 05 · 08

Data & money: free-recall review

Free-recall prompts across the data-and-money cases. Reconstruct each design from memory — cardinality, exactly-once and reconciliation, idempotency and the ledger, the lost update, exchange determinism, double-booking — then reveal and compare.

SDC Senior ◷ 14 min
Level
FoundationsJuniorMiddleSenior

Retrieval beats re-reading. For each prompt, reconstruct a full answer from memory — the mechanism and the fix — before you open the model answer. The effort of rebuilding is what makes the cardinality rule, exactly-once, and the lost-update fix stick.

Reconstruct each case’s core decision without looking back: what kills a metrics DB, what exactly-once does and doesn’t cover, how an idempotency key and a double-entry ledger keep money correct, how to defeat the lost update, why an exchange is single-threaded, and how to prevent a double-booking.

Recall before you leave
  1. 01
    What kills a metrics database, and how do you keep it alive?
  2. 02
    What does exactly-once cover in ad-click aggregation, and what handles the rest?
  3. 03
    How do an idempotency key and a double-entry ledger keep a payment correct?
  4. 04
    What is the lost update, and what's the single common fix shared with double-booking?
  5. 05
    Why is a stock exchange single-threaded, and how does that give recovery and audit?
Recap

If you could reconstruct each answer from memory, you hold the unit’s spine. Cardinality (the product of label cardinalities) kills a metrics DB, so keep labels bounded. Exactly-once is at-least-once + idempotent/transactional application and covers only the engine’s internal state — late events are a watermark concern recovered by batch reconciliation (lambda). A client idempotency key with atomic check-and-store stops the double charge, and an append-only double-entry ledger keeps money conserved, immutable, and auditable. The lost update and the double-booking are the same read-modify-write race, fixed by one atomic check-and-act (per balance, or per night all-or-nothing). And an exchange is single-threaded over a sequenced total order so a deterministic core makes the log enough for recovery, replicas, and audit. The thread tying them together: when the output is money or correctness-critical data, you reason in named hazards and apply precise, atomic fixes — before production teaches them to you.

Connected lessons

Something unclear?

Ask a question about this lesson. Questions are anonymous and go straight to the author to make the lesson better.

shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.