Skip to content
RED SAGSkills
medium10 pts · first answer countstransactionsconcurrencyatomic-updates

Flash sale stock without overselling

During a flash sale, many requests run this statement. How does the app know the item is sold out?

UPDATE items SET stock = stock - 1
WHERE id = 42 AND stock > 0;
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions