Idempotence is a principle of operations in mathematics and computer science. An idempotent operation is one where it can be applied multiple times without changing the result beyond the initial application.
This is an important principle in software design, especially in systems that interact with other systems (especially databases, distributed systems). For example, networked systems may be unreliable, so RPCs may need to be retried. For safety and reliability purposes, an API that modifies state should be idempotent so that operations aren’t done multiple times.
For example, consider a banking application. If an API wasn’t idempotent, this means multiple withdrawals or additions may be processed multiple times.
Idempotence is, in principle, achievable by uniquely identifying each individual operation (i.e., via UUID). This means that in retry scenarios, the same UUID can be used to identify a single operation, which can be compared against by the server.