Grokking Redis
Vote

0% completed

​

8.10 Design Flash-Sale Inventory

Ten thousand units of one product go on sale at noon, and one million users press "buy" within the first 60 seconds. A flash sale concentrates months of demand into minutes, all aimed at a few items. The system has one hard rule, never sell more units than exist, and one hard constraint: the database cannot handle the traffic directly.

The design follows from these two facts. Redis serves the contended stock counter with atomic operations, admission control and queues protect the database and the payment provider, and a reconciliation job checks Redis against the durable records afterward

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content