Two bids at once
Bad: Read, decide, write
Both read Asha’s $50 and write “I lead at $51”. Ben’s $55 vanishes.
Good: Lock the row
Bids queue on the lock: Ben at $51, then Chen at $56.
Asha’s max is $50, Chen’s $60. What does Chen pay?
Robots raising one step at a time trade about 36 bids. Skip the duel: the runner-up’s maximum plus one increment.
2,000
bids on one item in its final second
A locked row serves about 500 a second. The last two seconds bring 2,800; the 1,800 left over need 3.6 s more, past the end.
One owner per auction, deciding in memory
Bids queue in arrival order. Every 5 ms the owner writes a batch to a log kept on three machines, then answers. About 10 ms, not 3.6 s.
“Ends at 20:00:00.” A bid tapped at 19:59:59.990 is still in flight. Does it count?
The trick
The owner writes CLOSE into the same log as the bids. Arrived before it? Counts. After? “Ended”.
200,000 watchers. Do they need 2,000 prices a second?
Publish only the latest state, at most twice a second. 400 million messages a second become 400,000, and outbid bidders still hear at once.
After the hammer falls
- Create one order per auction
- Take payment, or autopay after 24 hours
- Pay the seller once money is captured
- Unpaid? A second-chance offer to an underbidder
Remember
One writer, one ordered log per auction: every bid, and the close, takes a place in it. Watchers get the latest price only.