|
|
|
|
|
by stickfigure
47 days ago
|
|
This is all way too much. If you see a duplicate idempotency key, skip the replay and always return 409. This becomes a client problem. Clients already need to help enforce idempotent contracts; "check for conflict response" is not an onerous imposition. I've built multiple ecommerce APIs with this approach and they work great. No heroic measures required. You can often satisfy this contract with a unique constraint; if not, a simple presence check in redis. No hashing or worrying about PII. My rant about this: https://github.com/stickfigure/blog/wiki/How-to-%28and-how-n... |
|