conv.

All stories
TechRunning 19h

Shopify replaced Redis with MySQL for inventory reservations at scale

Shopify rebuilt its oversell protection system using MySQL instead of Redis, handling record Black Friday 2025 traffic of $5.1M in sales per minute.

Conversation activity · last 29 hours peak 2/hr

Peak 2 items in one hour at Aug 8, 5 PM; 12 items over 29 hours Aug 8, 5 PM — 2 itemsAug 8, 6 PM — no itemsAug 8, 7 PM — no itemsAug 8, 8 PM — no itemsAug 8, 9 PM — 2 itemsAug 8, 10 PM — no itemsAug 8, 11 PM — 1 itemAug 9, 12 AM — no itemsAug 9, 1 AM — no itemsAug 9, 2 AM — no itemsAug 9, 3 AM — no itemsAug 9, 4 AM — 1 itemAug 9, 5 AM — 1 itemAug 9, 6 AM — 1 itemAug 9, 7 AM — no itemsAug 9, 8 AM — 1 itemAug 9, 9 AM — no itemsAug 9, 10 AM — no itemsAug 9, 11 AM — 2 itemsAug 9, 12 PM — no itemsAug 9, 1 PM — 1 itemAug 9, 2 PM — no itemsAug 9, 3 PM — no itemsAug 9, 4 PM — no itemsAug 9, 5 PM — no itemsAug 9, 6 PM — no itemsAug 9, 7 PM — no itemsAug 9, 8 PM — no itemsAug 9, 9 PM — no items 2 items · 5 PM
Aug 9

Summary, timeline and people extracted by Claude from 12 items across 2 sources · 9h ago. Quotes are verbatim.

Shopify migrated its inventory reservation system from Redis to MySQL, leveraging MySQL 8's SKIP LOCKED feature to handle concurrent checkout operations at massive scale. The move unified their database strategy while maintaining ACID guarantees and preventing both overselling and underselling during peak traffic events like Black Friday 2025, which saw an 11% year-over-year increase in sales per minute.

  • Shopify successfully migrated inventory reservations from Redis to MySQL using MySQL 8's SKIP LOCKED feature for concurrent access.
  • The new system maintains ACID guarantees between reservations and the inventory ledger while supporting multi-location inventory awareness.
  • The migration handled Black Friday 2025 peak traffic of $5.1M sales/minute without dropping requests or breaking consistency.
  • The real bottleneck identified was not what was initially observed and measured, suggesting deeper architectural insights beyond the database choice.

How it unfolded

  1. Reaction Hacker News discussion begins

    The post reached Hacker News frontpage with 285 points and 187 comments, generating developer discussion about the architecture decision.

  2. Report Shopify engineering post published

    Shopify published a detailed technical post explaining how they replaced Redis with MySQL for inventory reservations and what they learned from the migration.

  3. 36 weeks quiet
  4. Event Black Friday 2025 record traffic

    Shopify merchants hit a record $5.1 million in sales per minute at peak, representing an 11% increase over the prior year.

What people are saying verbatim

“During checkout, when a buyer clicks "Complete purchase," we need to guarantee the items they're buying are still available.”

Shopify engineering · Shopify engineering blog · Aug 7

“If we get this wrong in one direction, two buyers purchase the same last unit: the merchant has to cancel an order, send an apology email, and eat the support cost.”

Shopify engineering · Shopify engineering blog · Aug 7

“On Black Friday 2025, merchants on our platform hit a record $5.1 million in sales per minute at peak.”

Shopify engineering · Shopify engineering blog · Aug 7

“The hardest lesson wasn't about database design. It was discovering that the real bottleneck wasn't what we were observing and measuring.”

Shopify engineering · Shopify engineering blog · Aug 7

Voices from the web unedited

  • I wonder how we could handle that in a simpler way with durable workflows (e.g. Temporal, Restante, DBOS) – which are similar to Erlang processes but with persistent disk storage. This could avoid the need to maintain the 1000 row inventory.Perhaps each shopping cart would have its own workflow, and the inventory item would have one as well. Then…

    giovannibonettiHacker News13h agoview on Hacker News ↗
  • > Instead of one row per item with a quantity column, we use one row per sellable unit. An item with 10 units has 10 rows.> But one row per unit for all inventory would break down at scale—an item with 50,000 units across 10 locations would mean 500,000 rows, and the reserve query would slow as it scans through them. Instead, we maintain a bounded…

    manbashHacker News1d agoview on Hacker News ↗
  • It seems there could be a simpler solution.1. Deduct the reservation from the inventory when the user starts to order, but in the same txn also maintain a separate row for the in progress order flow. 2. If the order flow is aborted or times out have a background process that returns these to the inventory.That seems simpler than this approach and…

    isignalHacker News1d agoview on Hacker News ↗
  • not the best design to have 1000 rows for each shop*SKU combination. If a candidate proposed this solution during Shopify's System Design interview, i doubt he would be vetted for Senior+ position.Instead of having 1000 rows per shop*SKU, why not just have one row per shopping cart*SKU?That way a single row would represent a single cart, and will…

    bijowo1676Hacker News22h agoview on Hacker News ↗
  • My main takeaway from this post is that in 2026 we haven't developed enough technology to scalably and durably handle concurrently decrementing a single number. This has caused multiple organizations to develop database hacks (the multiple rows) or complex architectural solutions (redis) which destroy the atomicity of the process.

    jhhhHacker News10h agoview on Hacker News ↗
  • Could not they shard the inventory table by shop_id? As I understand, the order includes only items from one store, so there is no need to keep all the stores in a single table.Also, I wonder why they could not have a row status (available/reserved) and UPDATE it instead of deleting the rows.

    codedokodeHacker News17h agoview on Hacker News ↗
  • Mostly unrelated but shopify is incredibly annoying. They introduced this delivery tracking app called "shop" and it has become unavoidable when buying electronics from china. Recently looked at it with mitmproxy and it ships home more than gets shipped to me.

    sureglymopHacker News16h agoview on Hacker News ↗
  • Why even have a blog when you can't be arsed to write the posts. This is so obviously LLM-written. I have a positive view of Shopify engineers, but this kind of made a dent in that confidence.

    ramon156Hacker News15h agoview on Hacker News ↗
  • The high contrast dark theme made my eyes squint and I started getting a headache within 60 seconds of trying to read the page. The war on light themes needs to end.

    newsofthedayHacker News10h agoview on Hacker News ↗
  • I don’t get Why AI written technical article is a big thing here. Did we care if an article is typed or handwritten at a point?

    lordmomaHacker News8h agoview on Hacker News ↗