SD-32 · CARD PAYMENT PROCESSING · INTERACTIVEBreak it.
Break it.
Then fix it.
It is the busiest shopping day of the year. Turn up the payments, watch what breaks, and add the parts a real payment processor needs. Every switch is a decision you would defend in an interview.
CHALLENGEAuthorize 10K payments/s with p99 under 1 s, no errors and zero double charges.
StatusDOWNAt 5K payments per second
Auth p992,000+ msTarget under 1,000 ms
Errors70%Payments being dropped
Double charges0Retries return the saved answer
Monthly cost$7,050One database
MerchantsLIVE
5.0K auths/s · 50 retries/straffic source
API gatewayOK
Keys + idempotencyspreading 5.0K/s
Payment API × 9OK
Waits on merchant webhooks5.0K / 7.2K auths/s
Acquirer linkDOWN
One link, 1,500/s at most5.0K / 1.5K auths/s
Payments DBDOWN
4 writes per payment20K / 10K writes/s
LedgerOK
Big merchant on one account row500 / 1.0K postings/s
Payments wait on merchants' webhooks. Each request calls the merchant's webhook before answering, adding about 500 ms and holding a thread, so a server takes only 800 auths a second. Write an outbox row with the payment and send from workers.
1 in 100Calls that are retriesWithout idempotency keys, each one can charge a shopper twice.
≈ 280 msSpent at the bankMost of an authorization is waiting, so never block a thread on it.
0Sum of every ledger transactionDouble entry: money always leaves one account and enters another.
10 sThen reverseA bank that does not answer gets a reversal, never a guess.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.