Design a bidding platform (eBay)

Functional

Data

how to order the bids

bid engine design - need high throughput

Message delivery to interested parties

Kafka, where multiple consumer can subscribe to it

def handleBid(auction_id, bid, price):
	auction_state = getAuctionState(auction_id)

	with lock:
		sequence_number = auction_state.next 
		accepted = bid.price > auction_state.price and time < auction.end_time
		if accepted:
			auction_state.price = bid.price 

	await uploadToKafka(bid, sequence_number, accepted)

	return accepted