Live data from Hacker News

We replaced Redis with MySQL for inventory reservations and it scaled

shopify.engineering

251–260 of 280 posts

Re: We replaced Redis with MySQL for inventory reservations and it scaled

#251

Earlier quoted context omitted.

> re concurrency, it is not a big issue at all I would really appreciate it if you could write this up as an article. It would be an extremely interesting and valuable read

Martin Fowler's overview of LMAX Disruptor is one of the best reads on this subject re high-load system design https://martinfowler.com/articles/lmax.html

> re concurrency, it is not a big issue at all

> LMAX Disruptor

If anything this article shows that concurrency is a big issue. It is such a big issue you have to write in-memory single threaded processor with custom journaling. If you have established workflows with MySQL and a team knowing how to work with it, throwing all that to do LMAX is not cost efficient. While there are domains where such approach is suitable and even required due to strict transaction ordering, Shopify case doesn’t look like one of them.

Re: We replaced Redis with MySQL for inventory reservations and it scaled

#253
post #212

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.

The benefit of per row is that you can tag additional info like reserved user id etc, which you would have to track somewhere anyway.

Re: We replaced Redis with MySQL for inventory reservations and it scaled

#254

Earlier quoted context omitted.

Well, one thing to remember: AI learned from us (See what I did, there?) . The training these LLMs got, was from endless human-slop, on sites like LinkedIn, and marketing copy, everywhere. In fact, don't be surprised, if we start learning from AI; reversing the process. But I think that it's only a matter of time, before almost everything will be at least touched by AI. I posted this, yesterday[0]. It wasn't a partic…

Yeah, people act like this style is new, when it absolutely is not. There's this weird romanticism of the time pre-LLMs where people imply all writing/code was perfect, and only now it's slop. EDIT I also read your linked comment and agree 100%.

> Yeah, people act like this style is new, when it absolutely is not.

Every time this claim is made I ask for a link to a pre-2022 blog or article that has all those AI tells.

I'm still waiting for it. I don't think I will ever receive it.

Re: We replaced Redis with MySQL for inventory reservations and it scaled

#255

Earlier quoted context omitted.

On a large scale "rare" events happen every day. That is why people use locks and transactions or other measures. In case with shopify, they want to decide whether the user may place order or not, at the moment when the user clicks "Pay" or some other button. If the user cannot place an order, they are shown the error, if they can, the items are reserved and the user is redirected to the payment page. So payment is p…

shopify is wrapping their entire dance with locking and moving rows inside a transaction. if you wrap step 1-3 inside transaction you will get same atomicity guarantee but again, my idea was: 1) do not use throwaway placeholder rows to imitate a single item 2) do not rely on db engine to decide which transaction gets committed first (which customer gets the last item) 3) model queue explicitly by introducing counter…

No, using transactions won't change anything here.

> do not use throwaway placeholder rows to imitate a single item

The point of using multiple rows for one product is to distribute the locks.

Re: We replaced Redis with MySQL for inventory reservations and it scaled

#256

Earlier quoted context omitted.

Yeah, people act like this style is new, when it absolutely is not. There's this weird romanticism of the time pre-LLMs where people imply all writing/code was perfect, and only now it's slop. EDIT I also read your linked comment and agree 100%.

> Yeah, people act like this style is new, when it absolutely is not. Every time this claim is made I ask for a link to a pre-2022 blog or article that has all those AI tells. I'm still waiting for it. I don't think I will ever receive it.

It's likely because no one could be bothered to respond. There's plenty there, but it's not their job to fetch it for you.

People on the Internet (especially here), seem to think that it's OK to make rude demands of complete strangers, and expect them to spend considerable time, meeting them.

I'd rather some rando think they "won the Internet," than spend a bunch of my time, working for free, just to satisfy them. I have better things to do with my time, and I don't really have a lot of investment in what complete strangers think of me.

Sometimes, the fox ain't worth the chase.

Re: We replaced Redis with MySQL for inventory reservations and it scaled

#257

Earlier quoted context omitted.

Sounded to me like they were saying people vape in the office, which would make a bad work environment on top of the far right bros.

> people vape in the office It's famously a fully remote company.

Shopify has employee "ports" (company jargon for employee workspaces/offices) in Toronto, Ottawa and New York.

Re: We replaced Redis with MySQL for inventory reservations and it scaled

#259

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.

I have a gemini gem that recompresses the expansion that AI causes. It seems to have worked great on this article!

https://share.gemini.google/WxEi6Satj7mY

Happy to share the gem with anybody who's interested in reading articles like this without having to muddle through all the AI bulk.

Re: We replaced Redis with MySQL for inventory reservations and it scaled

#260

Earlier quoted context omitted.

> Yeah, people act like this style is new, when it absolutely is not. Every time this claim is made I ask for a link to a pre-2022 blog or article that has all those AI tells. I'm still waiting for it. I don't think I will ever receive it.

It's likely because no one could be bothered to respond. There's plenty there, but it's not their job to fetch it for you. People on the Internet (especially here), seem to think that it's OK to make rude demands of complete strangers, and expect them to spend considerable time, meeting them. I'd rather some rando think they "won the Internet," than spend a bunch of my time, working for free, just to satisfy them. I…

> There's plenty there, but it's not their job to fetch it for you.

It's been asked about 30 times now. If it existed, someone would have posted it. Maybe you.

Post reply on HN