E-commerce system design: handling flash sales, inventory and payment failures
A flash sale tests more than traffic. How to reserve limited stock safely, treat payment timeouts as unknown, and recover when a customer pays but the order cannot be confirmed.