eBay / Auction System — Detailed#
flowchart TB
subgraph Clients
SEL[Seller]
BID[Bidder]
end
subgraph Edge
CDN
GW
end
subgraph Listing
LSVC[Listing Service]
LDB[(Listings)]
IMG[Images / S3]
end
subgraph Search
SRCH[Search]
IDX[(Inverted index)]
REC([Recommendation])
end
subgraph Auction[Auction Engine]
AUC[Auction Service<br/>per-item shard]
AUCDB[(Auction state<br/>strong consistency)]
PROXY[Proxy bidding<br/>auto-rebid up to max]
SNIPE[Anti-snipe extension]
TICK[Closing clock]
NTQ[[(Pending bids queue)]]
end
subgraph Pay
PAYWIN[Winner payment service]
PAYSTRIPE((Payment provider))
HOLD[Authorization hold]
end
subgraph Notif
WS[[WebSocket / SSE bid stream]]
PUSH[Push / email]
end
subgraph Trust
FRAUD[Fraud detection]
DISP[Dispute / chargeback]
SAFE[Buyer/seller protection]
end
subgraph Real
LB[Auction LB<br/>sticky by listing_id]
end
SEL --> Listing
Listing --> Search
BID --> CDN --> GW --> LB --> Auction
Auction --> AUCDB
AUC --> PROXY
AUC --> SNIPE
AUC --> NTQ
Auction --> Notif
Auction -. winner .-> Pay
Trust --- Pay
classDef client fill:#dbeafe,stroke:#1e40af,stroke-width:1px,color:#0f172a;
classDef edge fill:#cffafe,stroke:#0e7490,stroke-width:1px,color:#0f172a;
classDef service fill:#fef3c7,stroke:#92400e,stroke-width:1px,color:#0f172a;
classDef datastore fill:#fee2e2,stroke:#991b1b,stroke-width:1px,color:#0f172a;
classDef cache fill:#fed7aa,stroke:#9a3412,stroke-width:1px,color:#0f172a;
classDef queue fill:#ede9fe,stroke:#5b21b6,stroke-width:1px,color:#0f172a;
classDef compute fill:#d1fae5,stroke:#065f46,stroke-width:1px,color:#0f172a;
classDef storage fill:#e5e7eb,stroke:#374151,stroke-width:1px,color:#0f172a;
classDef external fill:#fce7f3,stroke:#9d174d,stroke-width:1px,color:#0f172a;
classDef obs fill:#f3e8ff,stroke:#6b21a8,stroke-width:1px,color:#0f172a;
class LB edge;
class SEL,BID,LSVC,SRCH,AUC,PROXY,SNIPE,TICK,PAYWIN,HOLD,PUSH,FRAUD,DISP,SAFE service;
class LDB,IDX,AUCDB,NTQ datastore;
class WS queue;
class REC compute;
class IMG storage;
class PAYSTRIPE external;
Auction correctness#
- All bids for a listing must serialize on a single owner (shard by
listing_id). - Each bid: validate amount ≥ current + increment, atomic CAS update, persist event.
- Replicate to followers; reads from followers may show stale leaderboard — that's acceptable.
Proxy bidding#
- Bidder sets
max_bid; system auto-rebids minimum required up to max. - Stored as private field; visible to all is current high-bid only.
Anti-snipe#
- Last-minute bid extends auction by N seconds.
- Prevents server-clock gaming + last-second sniping.
Glossary & fundamentals#
Concepts referenced in this design. Each row links to its canonical page; the tag column shows whether it is a high-level (HLD) or low-level (LLD) concept.
| Tag | Concept | What it is | Page |
|---|---|---|---|
HLD |
CDN | edge caching for static assets | cdn |
HLD |
Sharding | horizontal partitioning across nodes | database-sharding |
HLD |
CAP / PACELC | C vs A under partition; L vs C otherwise | cap-pacelc |
HLD |
Leader/follower replication | sync/semi-sync/async replication, failover | replication-leader-follower |
HLD |
Realtime protocols | WS / SSE / polling / gRPC streaming | realtime-protocols |
HLD |
Search internals | inverted index, BM25, embeddings, ANN | search-internals |
LLD |
Structural patterns | Adapter, Decorator, Facade, Proxy, Composite | structural-patterns |
LLD |
Concurrency primitives | mutex, semaphore, RW lock, atomic, CAS | concurrency-primitives |