Why aren't you idempotent?
Very good review about some techniques to achieve idempotency.One interesting insight is the performance implications of idempotency. It is quite known that an idempotent action is more resilient, since it can be retired safely, but the article goes beyond explaining how can it also improve latency by hedging requests: Per Jeff Dean in The Tail at Scale, one of the most effective ways to curb latency variability is to hedge your requests, which means to send it to many replicas. This is very similar to retrying on a timeout (or other error), except you're being more proactive and typically hedge after a delay much shorter than your configured timeout.Hedging comes with the same precondition of idempotency as many replicas could be processing the request in parallel.