System Design Atlas

Account posting and bank transfers

03 / 10Worked example

Scale and contention

Which load profiles show total volume and contention on an account?

The requirements are checked under a concrete, fictitious scale: 86,400 transfers/day. Mean, peak and contention are considered separately.

Starting point Check available funds in the same transaction as the debit.

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.

Throughput and the contended resource

Load profile · Throughput and account contention separately

86,400Transfers / day÷ 86,400 s = 1/s
20/sfor 900 seconds= 18,000 orders
10,000 centsTwo requests for 7,000 cents
Winner 7,000
Loser Rejected
Final balance of 3,000 cents

Daily volume sizes storage, peak load sizes the worker, and contention tests the atomic balance check.

An pooled account receives many payments at the same time. Test total load and competing debits separately. 20 transfers/s say nothing about 50 hits on K-41.

Reproducible test profile calculations

  1. 01

    Average load

    86,400 transfers/day

    86,400 ÷ 86,400 s = 1 transfer/s

    For the designThe rate describes the assumed total volume; response time still requires measurement.

  2. 02

    Peak test

    20 transfers/s for 900 s = 18,000 transfers

    2 journal lines × 86,400 = 172,800 lines/day

    For the designThe additional quantity calculation defines a separate check of resource or retention needs.

Test concurrency separately

Test oracle
Two different transfers of 7,000 cents each compete at 10,000 cents. In both commit sequences, exactly one wins; the final balance is 3,000 cents, the journal contains exactly their two lines.

Measure account hotspots

Measure account hotspots

Test overall load and competing debits separately.

An pooled account receives many payments at the same time.

20 transfers/s say nothing about 50 hits on K-41.

Alternative considered
Only averaged throughput conceals account locks.
Trade-off
Two test profiles require separate evaluation.
Reassess
A real pooled account exceeds the assumed contention profile.

Terms in this step

Measure account hotspots
20 transfers/s say nothing about 50 hits on K-41.

Try it yourself

Calculate the mean transfer rate and the number in the 15-minute peak test. Complete an account hotspot test.

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
86,400 transfers by 86,400 seconds result in 1/s. 20/s times 900 s gives 18,000 transfers.
Second part of the solution
50 simultaneous debits on K-41 additionally check the waiting time and available-funds rule. The good overall mean does not replace this result.

Apply to your project

Which corresponding assumption in your project would you check first? Use as an occasion: A real pooled account exceeds the assumed contention profile.

Step 4: Recognise the same command.