System Design Atlas

Account posting and bank transfers

07 / 10Worked example

Critical flow

How is an unknown external settlement outcome clarified?

We track the point of failure through the architecture: After external success, the response is lost. U-41 remains open; A-41 is queried. A time-out does not allow a reversal posting. Only a definitive rejection triggers exactly a reversal posting. Durable acceptance, actual effect and response are considered individually.

Starting point The posting API and worker share a transactional ledger and outbox store.

Assumptions for the example case

Our own fictitious example draft: transfer in EUR with positive whole cent amounts; a debited customer account and an internal settlement account; external settlement with status query; reversal posting after proven rejection. Figures and quality goals are illustrative test assumptions. Outside are foreign exchange, interest, fees, regulatory approval check and a complete bank ledger.

Failure point in the sequence

Critical Process · Commit, Error Time and Resumption

U-41 and A-41 are locally committed. The external processing succeeds; their response is lost.

Accounts interface
Posting API
Journal store
Settlement worker
External settlement
  1. 01 Accounts interface → Posting APIU-41 release · 7,000 cents
  2. 02 Posting API → Journal storeStore ledger + A-41 + outbox atomically
  3. 03 Journal store → Posting APICommit is durable
  4. 04 Settlement worker → Journal storeLoad A-41
  5. 05 Settlement worker → External settlementSend A-41
  6. 06 External settlement · Local processingSettlement succeeds; response is lost
  7. 07 Settlement worker → Journal storeOutcome unknown · keep open
  8. 08 Settlement worker → External settlementQuery A-41 using its reference
  9. 09 External settlement → Settlement workerProve final outcome
  10. 10 Settlement worker → Journal storeCommit inbox result

Result: U-41 receives exactly one evidenced terminal state; a timeout alone does not create a reversal posting.

The stored instruction remains the reference for reconciliation. Only definitive rejection creates the single reversal record.

External settlement succeeds, but the response is lost. Query A-41 and retain abwicklung_offen until the outcome is evidenced. A lost response must neither debit again nor release funds prematurely.

Effect, response and recovery

Specific error
After external success, the response is lost. U-41 remains open; A-41 is queried. A time-out does not allow a reversal posting. Only a definitive rejection triggers exactly a reversal posting.
Before and after commit
Commit durably completes the local change. Before commit, the old state remains valid; afterwards, an identical retry returns the stored outcome. Reconcile the external effect using its existing reference.
Retry behaviour
Submit A-41 twice with the same payee and 7,000 cents: one external effect. The same key with 7,001 cents causes a conflict. After a reversal posting, an identical retry of the original command returns its historical record without posting again.

Preserve an uncertain outcome

Preserve an uncertain outcome

Query A-41 and retain abwicklung_offen until the outcome is evidenced.

External settlement works, the answer is missing.

A lost response must not be allowed to debit again or to return funds prematurely.

Alternative considered
Timer-based reversal posting can finance a processed transfer.
Trade-off
Funds remain tied up during clarification.
Reassess
The external service no longer offers persistent status reconciliation.

Terms in this step

Preserve an uncertain outcome
A lost response must not be allowed to debit again or to return funds prematurely.

Try it yourself

The external settlement confirms success, but the response is lost. Predict the local status and the next message.

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
U-41 remains open; neither second entry nor reversal posting is triggered.
Second part of the solution
The worker queries the existing A-41. Matching final success moves it to abgewickelt; definitive rejection permits the single reversal record.

Apply to your project

Which corresponding assumption in your project would you check first? Use as an occasion: The external service no longer offers a persistent status reconciliation.

Step 8: Reduce lock wait time.