It was a distributed system. The inventory was kept in Mongo with atomic debits and credits applied with a bus in front. SQL existed for the actual order, but inventory was managed in Mongo fine.
I'd like two of this product? Increment reserved in Mongo atomically, fire a bus message that inventory was reserved. I'd now like just one? Again atomically remove one from reserved and fire another message. Simplified of course.
Two users can't reserve the same inventory, reserving the inventory is atomic, and everyone else occurs during reconciliation. Typical distributed systems.