Loading system design concepts and challenges…
The word "idempotent" comes from mathematics. An operation is idempotent if applying it multiple times produces the same result as applying it once.
f(f(x)) = f(x)
In software:
| Operation | Idempotent? | Why |
|---|---|---|
GET /users/42 | ✅ Yes | Reading does not change state |
DELETE /users/42 | ✅ Yes | Deleting twice = same end state (user is gone) |
PUT /users/42 {name: "Alice"} | ✅ Yes | Setting a value twice = same result |
POST /orders | ❌ No (by default) | Each call creates a NEW order |
POST /payments | ❌ No (by default) | Each call charges the customer again |
The goal of idempotency design is to make non-idempotent operations safe to retry.