800M
price messages a second, sending every tick
2 million connections × 40 symbols; assume 10 ticks a second at the open. Send only the 10 on screen, at most 4 a second, and it’s 80 million.
24 ticks in one second. The phone gets four.
The gateway keeps one slot per symbol, overwritten by each tick. Every 250 ms it sends the newest. A slow phone just gets fewer.
Bad: Send, then save
Crash in between: a live order nobody recorded. Retry: it’s sent twice.
Good: Key, then one transaction
A retry finds its key. Order, money block and outbox row commit together; the connector sends.
Asha has ₹50,000. Her phone and laptop buy at once.
₹30,500 + ₹30,000 won’t both fit. Checking and blocking are one write, so the second order sees ₹19,500 left and fails.
The exchange link drops right after order c-77 leaves. Resend under a new ID?
The trick
That buys 40 shares, not 20. Keep c-77: the numbered session replays the confirmation and fill you missed.
25,000
orders in the busiest second after 09:15
56 times the day’s average of 444 a second, and over long before an autoscaler could add a server.
Plan for 09:15 instead of reacting
- Pre-scale and warm caches by 08:45
- Drain overnight orders in the pre-open
- Cancels first; never drop an accepted order
- Ten cells: a bad one hurts a tenth of customers
Remember
Prices can skip: send what’s on screen, newest only. Orders can’t: block the money as you record them, send once, reconcile nightly.