UPI: 25 billion payments a month
In October 2026 UPI handled 25.47 billion payments, close to 10,000 every second on average and far more on a festival evening. You're running one twenty-fifth of an evening peak: 800 payments a second, plus 3,200 balance and status checks, 4,000 req/s in all. Every payment waits while two banks answer, and one database holds every rupee.
Play this levelPart of Bugpit Pro. It runs in your browser: build the design, press Run, and watch what breaks.
The lesson
A UPI payment crosses three systems. Your app sends it to the switch in the middle, run by NPCI. The switch asks the payer's bank to take the money and the payee's bank to give it. Two banks you don't run, and either one can be slow.
So don't keep the person waiting on both banks. Record the payment with its unique transaction ID, put it in a queue, and let workers talk to the banks. If a bank doesn't answer in time, NPCI's rules say: check the transaction's status, up to three times, then reverse it. Never just send it again.
That transaction ID is what makes retries safe. A worker that crashes halfway retries with the same ID, and the bank sees a payment it has already done, not a new one. Without it, a timeout becomes a double charge.
The ledger is where money lives, so it gets the strictest settings in the game. Replicas wait for every write, so a balance is never behind. Three machines, so only a majority can be the primary. And backups, because a bad write reaches every copy in seconds.
Last, the message saying you've been paid. It goes out from the workers after the money moves, never before.
What you have to achieve
4,000 requests a second at the busiest hour, 20% of them writes.
- No broken or illegal connections
- Use a Queue
- Use Email & Push
- Every read sees the latest write
- The database machines can always agree on one primary
- A mistaken delete can be undone
- No component is overloaded
- Workers clear the queue within the day
- Fewer than 0.1% of requests fail
- p99 response time under 500 ms
What you learn
Notice what made this safe, not fast: a queue, IDs, replicas that wait, a third machine and backups. UPI's real scale comes from spreading this work across hundreds of banks and apps, each holding its own ledger. The switch only routes and keeps score.
The real numbers behind it
- UPI processed 25.47 billion transactions worth INR 31.53 lakh crore in October 2026 (Reported: Entrepreneur India: UPI hits a record 25.47 billion transactions in October)
- After a timeout, a payment app should send a check-transaction request to the switch and record the status it returns (Published: NPCI UPI Circular 39: check the transaction after a timeout)
- With no response from the payee's bank, the switch checked the transaction up to three times, then asked for a reversal (Published: NPCI UPI OC 45: check-transaction and reversal after no response)
- 800 payments and 3,200 checks a second, one twenty-fifth of an evening peak. NPCI publishes monthly totals, not this mix (Estimate)
- The queue, workers and ledger here are a lesson in how a payment system stays safe, not NPCI's or any bank's exact design (Estimate)
Check yourself
A bank doesn't answer a UPI payment in time. What should happen next?
- Send the payment again
- Check the transaction's status, then reverse it if it never completed
- Tell the person it failed and forget it
Show the answer
Check the transaction's status, then reverse it if it never completed. Sending it again could charge twice. NPCI's rules say check the status, up to three times, then reverse.
What makes it safe for a worker to retry a payment after it crashes?
- A faster database
- The payment's unique transaction ID, so the bank recognises one it has already done
- Retrying quickly
Show the answer
The payment's unique transaction ID, so the bank recognises one it has already done. With the same ID, a retry is the same payment, not a new one. That's idempotency.