
Worried the Factory Might Build the Same Order Twice? I Thought a Lock Would Fix It — Turns Out It Was a Design Problem
To go faster, software runs many processes in parallel. But if two flows grab the same order and each sends it to production, that’s a real, physical loss for the company — scrapped goods. I thought ‘just add a lock’; it turned out I needed an idempotency key. The chase ran to an Oracle partial unique index — and the real fix was more than the index: a status column whose single value secretly meant two different things.