Building a Flash Sale Engine That Cannot Oversell: Distributed Locking and Optimistic Concurrency in NestJS
How I used Redis distributed locking, atomic stock decrements, and TypeORM optimistic locking to guarantee zero overselling under thousands of simultaneous purchase requests, and the race condition I had to fix to get there.
Jun 22, 20265 min read2



