System Design: Real-Time Online Auction Platform
You are asked to design an online auction system that supports real-time bidding at web scale. Assume a mix of desktop and mobile clients, global users, and many concurrent auctions.
Functional Requirements
-
Listing lifecycle: create, view, edit (before first valid bid), cancel (with restrictions), close.
-
Bidding: real-time bids, enforced minimum increments, reserve prices, buy-it-now, and anti-sniping protections.
-
Closeout: determine winner, collect payment, notify parties, and finalize auction state.
-
Real-time updates: push current price, bid events, reserve met status, time-left/extension, and closeout results to watchers.
Non-Functional Requirements
-
High availability and scalability across many concurrent auctions and watchers.
-
Strong consistency for winner determination and money-related state.
-
Low-latency bid processing and fanout (<200–300 ms p95 event-to-update as a target).
-
Observability, fraud detection, and reliable payments/settlement.
Deliverables
-
APIs (HTTP and real-time) for listings, bids, and buy-it-now.
-
Data model (schemas/entities, indexes) and event model.
-
Consistency model for winning bids and concurrency control strategy.
-
Real-time update design (WebSocket/streaming), ordering, and backpressure.
-
Anti-sniping policy and auction closeout flow.
-
Fraud detection hooks and controls.
-
Payments and settlement flows with idempotency.
-
Scalability, fault tolerance, and monitoring strategy.
Assume minimal context as needed (e.g., auctions are priced in a single currency; times are UTC).