In-flight request Sold Rejected / conflict

Flash-Sale Inventory Race Condition — 2D

Mobile e-commerce checkout is a textbook concurrency problem: many devices read the same stock count, wait through a network-plus-database round trip, then write a decision. This 2D companion trades the spatial silo-and-tokens view for a diagnostic instrument-panel: a scrolling stock-level chart shows the live counter dipping below zero, and a scrolling request timeline shows every checkout as a horizontal bar from spawn to resolution, colored orange while in flight, green when sold, red when rejected. Switch between no locking, optimistic concurrency (compare-and-swap on a version number) and pessimistic locking (a strict FIFO queue) while tuning starting stock, checkout rate and round-trip latency, and watch the "pipeline depth" readout — rate × latency — predict, in real time, exactly how many units No Lock will oversell.