Idempotent Requests
When a new request is created, we generate a nanoid and persist the request, start running it etc. There are times when request creation could time out, but indexify creates the request anyways, and the client retries and creates a new request with the same payload.
We should let the client pass a `X-Idempotency-Key`. We should use the key to check if the request exists in the database, if it does then we shouldn't create a new request, just return the same request id that exists in the database and return.
Thoughts on why pass an indempotency key vs asking the client for a key - This is a multi-tenant system so even if we asked users to pass a key we would have to hash the key with application name, namespace, etc, to create a unique key that doesn't clash with other tenants in the platform.
Can we use UUID5/8 to hash the idempotency key to generate stable UUIDs?
关闭于 2025-12-24 0 条评论