System Design Atlas

Social benefits with eligibility checks and appeals

07 / 10Worked example

Critical flow

The decision commit resolves concurrency. Which conditions ensure the result?

Approval and rejection both target version 3.

Starting point Only a committed approval opens a payment instruction.

Assumptions for the example case

A fictional municipal training example with a fixed grant of 300 euros. Caseworkers make the decision; a rules checker provides reasoned guidance. The design specifies no real eligibility requirements. All quantities, thresholds and operational targets are illustrative assumptions.

Commit the decision before payment

Commit the decision before payment

B-43 and Z-43 are jointly committed; payment response can be matched later.

Caseworkers
Benefits case API
Case datastore
Payment worker
Payment service
  1. 01 Caseworkers → Benefits case APIApproval of version3
  2. 02 Benefits case API → Case datastoreCommit B-43 + Z-43
  3. 03 Payment worker → Payment serviceZ-43 · 30,000 cents
  4. 04 Payment worker · Local processingResponse lost
  5. 05 Payment worker → Payment serviceZ-43 Reconciliation
  6. 06 Payment service → Benefits case APIAppropriate proof of payment

Result: One decision, one payment instruction and an evidenced outcome.

The payment worker follows the committed decision and reconciles the same instruction.

Caseworker → API → commit decision and instruction → worker → provider; response loss and reconciliation.

Commit, response loss and resumption

A-43 ready version 3
Approve/reject in both orders → exactly one decision version; a payment instruction exists only if approval wins.
decisionKey committed
Retry identically, then change outcome → original decision; changed retry causes a conflict.
Z-43 open
59,999/60,000/60,001 ms → clearing signal from 60,000; still unknown.

The decision commit resolves concurrent actions.

The decision commit resolves concurrent actions.

Exactly one decision increments the version.

Approval and rejection both target version 3.

Approval wins: approved decision and one payment instruction; rejection conflicts. Rejection wins: rejected decision and no payment instruction; approval conflicts.

Alternative considered
Last-write-wins would subsequently change the payout reason.
Trade-off
The losing action requires a fresh review.
Reassess
Further decision-making types need new transition rules.

Try it yourself

Predict both winning orders.

A hint for your attempt

Approval and rejection both target version 3.

Compare with a possible solution
Approval first
Approved decision and one payment instruction; rejection conflicts.
Rejection first
Rejected decision, no payment instruction; approval conflicts.

Apply to your project

How does this principle apply in your own project: The decision commit resolves concurrency.

Step 8: Outstanding evidence explains processing time. Which conditions ensure the result?