Production engineering
Reveal answer and reasoning
Design inbox storage around the authoritative operation identity, complete meaningful request representation and the exact local effect its transaction can own. Decide what conflicting reuse means to callers, how long identities remain and how a replay obtains its result. Preserve rollback, compatible replay and changed-input tests independently. The portable tuple makes equivalence readable, while real SQL establishes the local persistence boundary.
A production integration adds message transport and operational failure handling; it should carry a clearly stated at-least-once or deduplication contract rather than inheriting an unsupported exactly-once promise from the presence of an inbox table.
For multiple tenants or producers, define an identity namespace that prevents one source's key from colliding with another meaningful operation. Include all effect-changing fields in equivalence and decide how versioned payload contracts evolve. Use a transaction for the effect that shares the inbox owner, then reconcile anything outside it. Tests should inspect persisted totals after both duplicate and conflicting submissions, and should force rollback before the receipt becomes visible.
Avoid exposing raw payloads in logs merely to diagnose duplicate identity; store or report the minimum evidence needed for the contract.
What a strong answer covers
- The known tuple includes payload and amount; changed amount is not a compatible replay.
- The console effect remains3 after exact replay and conflict.
- The actual inbox and local SQL effect commit or roll back together; remote effects remain separate.
Common pitfall
Deduplicating only a label or claiming that an inbox transaction also covers an unrelated remote side effect.
Follow-up questions
- How should identity be namespaced across producers or tenants?
- What evidence distinguishes rollback before commit from replay after commit?
Self-review
Choose what to revisit. These marks are your own assessment and are separate from lesson completion.