Design a share purchasing system for a limited-time company crowdfunding event
Design a system that allows customers to purchase a selected number of company shares using their existing account balance during a limited-time crowdfunding event. The system must handle high concurrency (e.g. 5 million users in 1 hour), prevent overselling a fixed share pool, prevent purchases without sufficient balance, and ensure durable and auditable purchase records. The system integrates with an existing Balance Service that exposes lookupBalance, deposit, and withdraw APIs. Additional requirements include idempotency and retry safety, handling of reservation expiry and partial failures, and enforcement of event start/end time windows.
Asked at:
Wise