Digital Wallet: Payday Friday
Hard · system design problem
Payday: balance checks and transfers ×2.5 on a distributed SQL ledger with a per-node connection limit — then the bank’s top-up API slows to a crawl behind two retries.
wallet-api (autoscaling, 20 connections per instance) runs balances and transfers on CockroachDB (8 nodes, at most 20 client connections each); a quarter of its writes are card top-ups, which it hands to topup-svc, which calls the bank’s API (with 2 retries). At T+20s payday starts: traffic ×2.5 for the rest of the hour. At T+50s the bank’s API degrades: 8× slower at half its capacity. Top-ups may complete asynchronously within five minutes (the app shows “pending”); balances and transfers must stay synchronous.
Topics
More
Codelays runs in your browser: turn on JavaScript to use it.