Hacker News
Shopify Replaced Redis With MySQL for Inventory Reservations and It Scaled Through $5.1M/Minute on Black Friday
Shopify Engineering published how it moved inventory reservations out of a dedicated Redis cluster and into the same MySQL database as the inventory ledger, trading a cache for ACID transactions and eliminating the 'payment succeeds but inventory isn't claimed' split-brain class of bug. The enabler is MySQL 8's `SKIP LOCKED`, letting transactions skip locked rows instead of waiting; reservation pools cap at 1,000 rows per item/location. At Black Friday 2025 peak — $5.1M in sales per minute, up 11% year over year — writer CPU stayed under 50% and reader CPU under 16%, and the change removed 50% of reads and 33% of transactions from the primary. 234 points, 149 comments.
↳ Follow the thread