Stock Hold
A stock hold is a temporary Redis reservation that marks units as taken while an order is being processed or paid for. In this course, holds use SET NX EX 300 to create a five-minute reservation, while MySQL remains responsible for preventing overselling.
Minimal example
SET resv:order-123:item-42 1 NX EX 300
The key expires automatically after 300 seconds.