11
Make a backend operation safe to retry without creating duplicates.
Tap to write answer
0 words | 0 charsPress Enter ↵ to reveal
Your Attempt
0 wordsRefined Model Answer
ReferenceI would use an idempotency key and store it with the operation result or processing state. If the same key appears again, the server can return the earlier result instead of repeating the work. The reason I choose this design is that retries are normal and the business flow should stay correct even when the network is unreliable. I would also think about key expiration, partial failures, and what happens if the first request is still in progress when the retry arrives. This matters a lot for payments, order creation, and other state-changing actions.