π« Just solved the classic "Last Coupon" race condition!
Problem: 2 users grab the same "last" coupon β both succeed β overselling disaster
Solution: Version numbers on each coupon record.
Details in comments π
#BackendDev#Concurrency#SystemDesign