← Graph

Find-or-Create Pattern

concept 3 connections

Fallback pattern when a third-party API supports neither idempotency keys nor sender-chosen IDs: before creating, query an index endpoint with enough uniquely-identifying data to detect an existing resource; if found, acknowledge and stop; otherwise create. On retry, the check re-discovers the previously-created resource and avoids a duplicate. Caveats: prone to race conditions with multiple senders, and vulnerable to receiver-side consistency issues where the resource is created but a surrounding workflow fails invisibly. Sometimes the best available option, but inferior to proper idempotency-key support.

category
pattern
about
Find-or-Create Pattern concept
Asker notes the find-or-create fallback is impractical at scale.
about
Find-or-Create Pattern concept
Fallback when a third-party API lacks idempotency-key support.
concept Find-or-Create Pattern
related_to
Idempotency Key concept
Find-or-create is the fallback used when idempotency keys are not available.

Provenance

Read by
1 extraction