Idempotence
Idempotence
The property that repeating the same operation any number of times always produces the same result.
In Simple Terms
Idempotence is the property where repeating an operation any number of times always results in the same final state. For example, it's used when you buy a train ticket online — even if you mash the "purchase" button, you won't get charged twice. It's a technique used to keep systems working correctly even when a request gets sent multiple times because of a network error.
Behind the Name
The word "Idempotence" comes from Latin: "idem," meaning "same," combined with "potentia," meaning "power" or "effect." That combination captures the core idea perfectly — no matter how many times you perform the operation, the effect stays exactly the same, which is exactly why the name stuck.
Take a Closer Look!
Idempotence is the 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 setup where no matter how many times you mash a button, the system ends up in the same state as if you'd only pressed it once.
For example, imagine you're shopping online and accidentally click "place order" twice in a row.
With an idempotent system, only one order gets processed — the second click is simply ignored.
Without this property, you'd end up with two separate orders and get charged twice, which is obviously a problem.
In web and app development, this mechanism is especially useful when the network connection is unstable.
If you tap a button again because it seemed unresponsive, the server behind the scenes still only processes it once, safely.
That's why idempotence is such a valued property in programming and web design — it keeps systems safe and reliable even when network errors occur.