Hacker News new | ask | show | jobs
by linux2647 687 days ago
It’s kind of like an idempotency key assigned either by the request or generated at the beginning of processing that request
1 comments

If the caller/consumer isn't choosing the idempotence key then I don't think it would act as a particularly good one.

In this scenario the database is choosing the id during a transaction and so you'll only find out the value if the transaction successfully commits and the response makes it back to you.

Generally you'd want the client to provide the idempotency key such that whatever failure occurs you know the value and can provide it on a retry such that the server can use it to prevent double entry / etc