Problem Statement
How do you make a CreateOrder endpoint idempotent at the LLD level?
Explanation
Store the first successful response against the key. On a duplicate request, return the same outcome and avoid double effects.
Keep the key scoped per client and per route, and expire entries on a sensible TTL.
Code Solution
SolutionRead Only
result = store.get(key) ?? createOrder(); store.putIfAbsent(key, result);
Practice Sets
This question appears in the following practice sets:
