Idempotence
Idempotence
A property where repeating the same operation any number of times always produces the same result.
In Simple Terms
Idempotence is a property where no matter how many times you repeat an operation, the final state always ends up the same. For example, it's what keeps online train ticket purchases safe — even if you smash the "buy" button over and over, you won't get charged twice. It's a technique used to keep systems working correctly even when a request accidentally gets sent multiple times due to a network error.
Behind the Name
The word "Idempotence" comes from Latin: "idem", meaning "the same", combined with "potentia", meaning "power" or "effect". Put together, it describes something that has the same effect no matter how many times it's carried out — which is exactly where the name comes from.
Take a Closer Look!
Idempotence is a property where the result of performing an operation once is exactly the same as the result of performing that same operation over and over again.
Put simply, it's a mechanism that keeps things in the same state as if "only the first click actually happened," no matter how many times you mash the button.
For example, imagine accidentally clicking "Place Order" twice in a row while shopping online.
With an idempotent system, only one order gets processed, and the second click is simply ignored.
Without this property, you'd end up with two separate orders — and get charged twice.
In web and mobile app development, this mechanism also comes into play when the network connection is unstable.
Even if you keep tapping a button because nothing seems to be happening, the server safely processes it as a single request behind the scenes.
Because of this, idempotence is a property that's valued in programming and web design to keep systems safe and reliable even when network errors occur.