The Day Deposits Doubled: Idempotency, Race Conditions, and a Lock That Saved Us
A real war-room story about duplicated deposits in production — why a check-then-insert idempotency guard isn't enough under concurrency, and how flipping it to insert-first-then-check-with-a-row-lock fixed it for good.