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 involves no locking. Though their presented approach is also reasonab…
now you have two problems. what happens when your reservation system backs up?
We replaced Redis with MySQL for inventory reservations and it scaled
31–40 of 281 posts
Re: We replaced Redis with MySQL for inventory reservations and it scaled
#32They were really so proud of that AI image that they just had to tack it on at the end? Did nothing but make the blog post feel like cheap mass produced slop
Re: We replaced Redis with MySQL for inventory reservations and it scaled
#33It 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 involves no locking. Though their presented approach is also reasonab…
The moment you added a background process you just replaced the complexity. 1. Backgrounds process can back up 2. They need context of the user and need to switch context per user 3. What if they fail, you create some DLQ or another process to handle the failure 4. Who looks on those failure and how do they act TLDR; there is always a cost
Re: We replaced Redis with MySQL for inventory reservations and it scaled
#34Re: We replaced Redis with MySQL for inventory reservations and it scaled
#35"But the hardest lesson wasn't about database design. It was discovering that the real bottleneck wasn’t what we were observing and measuring."
It's honestly weird Claude converges on this language because it's incredibly wordy and hard to parse. One would think semantic density would win out in training.
Re: We replaced Redis with MySQL for inventory reservations and it scaled
#36It 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 involves no locking. Though their presented approach is also reasonab…
My understanding is: your proposal is not very different from what Shopify is doing except they are tracking 'reserved units' (one per row) and you are proposing tracking 'orders' as the temporary state to then reconcile back with inventory quantities.
Re: We replaced Redis with MySQL for inventory reservations and it scaled
#37It 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 involves no locking. Though their presented approach is also reasonab…
Can you clarify why this involves no locking? There can still be 2 actors fighting for the same row.
Re: We replaced Redis with MySQL for inventory reservations and it scaled
#38Shopify’s founder and their coo both fund far-right extremism, and its founder thinks only rich people should be able to vote. But anyway, they switched databases. https://www.techwontsave.us/episode/340_shopifys_leaders_are...
Yeah it's an awful place to work unless you're a far-right bro. My old director used to use slurs and vape in the office. The founder hires pro gamers with no technical expertise because he thinks they're cool.
Re: We replaced Redis with MySQL for inventory reservations and it scaled
#39Earlier quoted context omitted.
It's honestly weird Claude converges on this language because it's incredibly wordy and hard to parse. One would think semantic density would win out in training.
[flagged]