News for hackers. Stuff that matters.
Re:Heard of Idempotency but unsure what it is? by jmull on Monday June 10, 2024 @07:26PM (#40640501)
> Idempotency refers to the ability of an operation to be performed multiple times whilst still yielding the same outcome.

I'm not a fan of this definition because it might give someone the wrong impression.

Suppose the operation is "deposit $10 to account 1234". If that operation is processed twice, a total of $10 should be deposited to account 1234 (for it to be idempotent). By the definition from the article, it sounds like perhaps it would be idempotent if the operation deposited $10 each time it was processed.

Re:Heard of Idempotency but unsure what it is? by stackskipton on Monday June 10, 2024 @07:55PM (#40640708)
Yea, I see Idempotency as being you can submit same transaction multiple times without duplicate actions. So you to use your example, if I submitted "Deposit $10 to account 1234, transaction ID: ABC" four times, the system wouldn't execute it four times because it has enough data to determine if transaction is duplicate or not.
Re:Heard of Idempotency but unsure what it is? by layer8 on Monday June 10, 2024 @08:11PM (#40640812)
"Same state" instead of "same outcome" would make it clearer.