Idempotency
A property of an operation where repeating it has the same effect as doing it once, which matters for retries and duplicates.
Definition
Idempotency means doing the same operation multiple times has the same effect as doing it once.
It does not mean “no side effects.”
It means the side effects happen at most once.
Why it matters
In real systems, clients retry.
Networks drop responses.
Queues deliver duplicates.
If your operation is not idempotent, retries become bugs.
Common pattern
Use an idempotency key.
If the server sees the same key again, it returns the original result instead of performing the operation again.