Idempotent != Insanity

The definition of idempotent in the development world is to perform processing and, even if the same operation is performed multiple times, at the end of that processing the system is in exactly the same state as the first time you processed.  I first heard this word from a database developer who was writing idempotent scripts to update the database.  So, if we needed to add new rows to a lookup table as part of our rollout he would create an idempotent script so that no matter how many times you ran the script only the rows that needed to be added would be (the first time you ran it…subsequent runs would be checking for the presence of the rows already and simply do nothing). Idempotentcy is something that is also very important in processing data where you can’t guarantee you won’t get the same data to process more than once.

Now, there is also a very common saying attributed to Albert Einstein:

“Insanity: doing the same thing over and over again and expecting different results.”

Thus, idempotent must be the same as being sane.  If you are idempotent, you aren’t expecting different results.