Recording a Repeatable Request Identity

A stable request ID can let a transaction recognize and reuse the result of an ordinary repeated submission under an explicit policy.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace an acknowledgement gap
  2. Validate the same intent
  3. Compare a true repeat with a different request using the same key
  4. Define scope, lifetime and concurrency

Trace an acknowledgement gap

An order request creates order 41, but its reply is lost. A repeat with the same request ID can retrieve the earlier order rather than create another. Idempotency keys describe persisting that association.

Validate the same intent

A repeated ID with a different body may require a conflict outcome. Confirm both duplicate handling and normal distinct requests. Composite keys can scope identities to each account and operation.[1]

Compare a true repeat with a different request using the same key

A job creation request can carry a client-generated identity stored under a uniqueness rule. Repeating the same logical request returns its existing job. If another payload reuses the key, the service can flag a conflict instead of quietly accepting two meanings. See concurrent uniqueness.

Request Q with filters X → job 7
Repeat Q with filters X → retrieve job 7
Request Q with filters Y → documented conflict

Define scope, lifetime and concurrency

The same key may be valid for different accounts under a scoped constraint. Test simultaneous submissions, request timeouts after commit and conflicting reuse. Verify one durable work item remains.

References

  1. PostgreSQL Global Development Group, Concurrency Control ↩