Skip to content

Inventory reservation in MySQL: Shopify's row-lock design

7.9 relevance
Score Breakdown
technical depth
9
novelty
7
actionability
8
community
8
strategic
6
personal
8

Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.

Deep dive into Shopify's MySQL inventory reservation design, highly technical and applicable.

General dev.to
Inventory reservation in MySQL: Shopify's row-lock design
Summary

Shopify replaced a Redis-based inventory reservation with a MySQL design using `SELECT ... FOR UPDATE SKIP LOCKED` on a bounded pool of 1,000 rows per item/location. Each row represents a single available unit, letting concurrent checkouts acquire distinct locks instead of queuing on a shared counter. This architecture eliminates dual-write coordination failures between Redis and MySQL, enforces location-aware fulfillment, and cleanly separates the temporary reserve (payment hold) from the permanent claim (ledger deduction).

Author

Nikoloz Turazashvili (@axrisi)

More from Nikoloz Turazashvili (@axrisi) →