3 Comments
User's avatar
Raul Junco's avatar

Idempotency is underrated and under-implemented.

Too many systems lack the ability to safely handle retries, turning simple issues into complex failures.

Thanks for sharing this, Ashish!

Nitish Nandwana's avatar

Just curious. If the user is refreshing and starting again then the backend should be aware it's another handshake not so sure here whole picture.

Glenn's avatar

Hi

I like your posts and you're doing a great job but your "SQL INSERT ... ON CONFLICT" is not idempotent and will in fact continue to update stock on each conflict - from the 3rd try - assuming it didn't exist on the 1st try OR from the 2nd try - assuming it did exist on the 1st try.

:^)