Users and systems retry actions after double clicks, lost responses and temporary failures. Idempotency identifies a logical operation so repeating it does not repeat its business effect.
Give the intent an identity
In a fictional order-creation workflow, a lost response does not mean the order was never written. Associate an identifier with the logical operation and retain its result. Retries reuse that identity; a genuinely new order gets a new one.
| Test | Expected outcome |
|---|---|
| Double click | One order and a consistent result |
| Lost response | Retry finds the original operation |
| Same key, different request | Explicit conflict |
| Concurrent processing | One effective creation |
Handle concurrency on the server
Disabling a button improves interaction but does not protect against simultaneous requests. Design deduplication to survive concurrent processing. Define retention and expiry behaviour. When calling a provider, consult its exact idempotency contract rather than assuming all APIs preserve keys in the same way.
When should the user retry?
Distinguish definite failure from an unknown outcome. For an unknown outcome, inspect the operation or reuse its identity before creating anything new. Show a verification state rather than immediately encouraging another submission. Test interruption just after the write, where an error screen can conceal a successful business operation.
A retry from another device
A customer may repeat an uncertain action from a phone after losing a desktop connection. If operation identity exists only in the first browser tab, the second attempt can bypass deduplication. Design a server-visible recovery path for consequential submissions.
Sources and further reading
From this guide to your project
Development ↗
A SaaS is a system: data, users, permissions, billing and operations. Its architecture should support the business model.
Tell us about your ideaExamples are educational and do not describe client results. Content prepared with AI assistance; see our editorial policy. Our method ↗