Marketplaces & booking
Auction bidding - the clock is part of the system
Why bids are ordered by a sequence under one lock rather than a clock, and how soft close moves the end.
The first act plays here. Owned once with credits, never a subscription.
What this board gets wrong on purpose
The tension
Soft close is the fix for sniping and it is drawn here as one, but it is honestly unresolved in two directions. It makes the end time unbounded: two determined bidders can extend a lot for hours, the close job is re-armed every time, and a seller who advertised a 20:00 finish has no contractual end. And it only works if the losing bidder learns they were outbid in time to respond, which means the extension window has to be longer than the outbid notification path - a queue, an email provider and a human reading a phone. That path is minutes at p99 and the window is two minutes, so for most bidders the extension changes nothing and only the programs benefit, which is the opposite of what soft close is for. Underneath both sits the single-writer lot row: every bid on a contested lot in the last ten seconds serialises behind one SELECT ... FOR UPDATE, and there is no way to shard a row that is, definitionally, the thing everybody is fighting over.
Practise this as an interview
Take Auction bidding - the clock is part of the system as a timed system design interview on a blank board - on your own, with the requirements to check yourself against, or with a candidate you invite.
Start here
Why this design
Auction bidding is the system-design question where the load is tiny and the problem is hard: a few bids a second, all on one row, all in the last ten seconds. Interviewers use it to probe whether you can produce a total order without trusting wall clocks, whether you notice that proxy bidding means the stored state is not the price, and whether you treat the close time as state rather than a timestamp. Real marketplaces get it wrong in ways that end up as disputes and refunded sales, not as error rates.
What you will learn
- Why bids on a lot are ordered by a monotonic sequence assigned under one lock, never by timestamps, and how UNIQUE (lot_id, seq) makes the history evidential.
- How proxy bidding works: the lot row stores the visible price and the hidden high maximum, and every bid is resolved against the second.
- Why the design point is about 4 bids/s on one unshardable row with a 300 ms p99, not the 289 bids/s fleet average.
- Why scheduled closes live in a table with (state, fire_at) and locked_until rather than in-memory timers, and why a close and its job commit together.
- How soft close turns the clock into state that bids move - and why it only helps people if the outbid notification beats the two-minute window.
- Why bidding fails closed, and why a wrongly closed auction is fixed forward rather than rolled back.
How to read this board
- Diagram, top row: THE BIDDERS (one of them is a program), then ONE LOT, ONE LOCK - the gateway, the bid service, the red Lot row, the proxy resolver and the append-only bid history.
- Diagram, bottom row: THE CLOCK IS A COMPONENT, NOT A DATE (soft close, close jobs, the close worker), then EVERYONE ELSE, MILLISECONDS LATE (outbid events, notifications, the live price push). Press play for the eight-step walkthrough.
- The DATA MODEL under the diagram: bids.seq is the order, lots.high_max_minor is the secret, and lot_close_jobs keyed by lot makes re-arming idempotent.
- Page 1 · Requirements - the questions about ordering and time to ask first, and the targets.
- Pages 2 and 3 · Capacity and Storage - 25M bids/day, the 4 bids/s on one row that designs the system, and 21 TB in five years.
- Page 4 · Availability - why bidding fails closed, and the one degradation that changes product behaviour.
- Page 5 · How it works - a worked proxy-bid example, the sequence, the close job, sniping and soft close.
- Page 6 · Deployment plan - one region per lot, one time authority, deploying in the close trough, and the shadow proxy-resolver.
1 · Requirements
An auction is a sequence, not a set. Almost every requirement below is really a requirement about ordering or about time.
Ask these before designing
- Proxy bidding or literal bidding? Proxy - where a bidder enters a maximum and the system bids up on their behalf - is what customers expect and it means the stored state is not the price. That changes the schema and the whole concurrency story.
- Is sniping to be prevented, penalised or accepted? eBay accepts it. Most European auction houses use soft close. A sealed-bid or Vickrey format removes it entirely and is a different product.
- Who is the authority on time? If the close is 20:00:00, is that our clock, the seller’s local time, or an NTP-disciplined reference? A dispute over a bid placed at 19:59:59.8 is decided by this answer.
- Can a bid be retracted? Legally, sometimes. Retraction in a totally ordered sequence means tombstones rather than deletes.
- Is the reserve price visible? An invisible reserve means "not met" has to be shown without leaking the number, which constrains the read model.
- What is the increment schedule? Fixed, percentage, or banded by price. It is the core of proxy resolution and it is a business rule that changes.
Functional
- Place a bid with a maximum; resolve it against the current high maximum using the increment schedule.
- Maintain a totally ordered, append-only bid history that can settle a dispute.
- Notify a bidder when they are outbid.
- Close a lot at a defined time, declare a winner, and extend the close when a late bid arrives (soft close).
- Push live price changes to everybody watching.
Non-functional
- Bids on one lot are totally ordered, and the order does not depend on which application server received them.
- Bid p99 under 300 ms, including the lock wait, at 4 bids/s on a single contested lot.
- A bid is never silently lost. If it cannot be ordered, it must be refused with an error the bidder sees - an accepted-then-dropped bid is a legal problem, not a reliability metric.
- Close fires within 1 s of the scheduled time, at up to 125 closes/s during the daily close cluster.
- Read 99.99%, bid 99.95%, both failing closed on the write side.
Explicitly out of scope
Listing creation and catalogue search, seller payouts, shipping, fraud and shill-bidding detection (which is a real and much larger system), dispute resolution workflow.
The rest of this board
Available on Tier Slate
This page publishes the question. The answer — 5 more written pages, an 8-step narrated walkthrough and a 5-table schema — is the board itself, and it opens in Tierslate.
- 5written pages
- 8walkthrough steps
- 5tables32 columns
5 pages behind this one
- Capacity estimation
- Storage estimation
- Availability
- How it works
- Deployment plan