004 Computing Jargon of the Week

Idempotent

Idempotence is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application

https://en.wikipedia.org/wiki/Idempotence

What it basically means

This is where I usually try to provide a more simplified word for the jargon, but with this I couldn’t. I just had to learn what it meant.

As per the above quote, an action is idempotent when performing that action multiple times on a set has no other effect on that set over the first time it was applied.

That was a bit of a mouthful…The best explanation I could find on this topic was in the following Youtube video by Corey Schafer (found in a WhatIs article). It provides an example and shows that if you request the absolute value of 10 then the result of that call is 10. But, no matter how many times you call the absolute value on that same call, it will always result in 10. This is what makes the absolute function idempotent.

It was interesting to see how this applies to computing and particularly Corey’s explanation of different HTTP methods. GET is idempotent as no matter how many GET calls you make it won’t change the underlying data itself. Also, by calling PUT multiple times it doesn’t change the set any more than the first time you called it. This is important to note!

POST however is not idempotent as it changes the underlying data set and multiple posts will create multiple entries to that set.

DELETE however was interesting as it said if you call DELETE on a certain item multiple times then it can only be deleted once, meaning that DELETE is idempotent. My thought here is that it must only be idempotent if you’re calling DELETE on a specific item, rather than just calling DELETE on, say, the last entry in the set – this to me would not be idempotent.

This was really good to know and improve my knowledge on!

Further reading

https://whatis.techtarget.com/definition/idempotence

https://www.restapitutorial.com/lessons/idempotency.html

https://stackoverflow.com/questions/1077412/what-is-an-idempotent-operation