Idempotency Keys and Durable Deduplication

Bind a request identity to its exact operation and make duplicate recognition atomic with the durable effect.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Define the unit that can be repeated
  2. Race outcomes need a single decision

Define the unit that can be repeated

A create operation can receive a unique key within a specified caller and action scope. Repeating the same key and same logical arguments should return the previous result under the contract. Reusing that key with different arguments should be detected. Persist the identity and relevant request fingerprint along with the data needed to reproduce the response. Do not rely solely on a worker’s memory if the retry can reach a different worker.

Race outcomes need a single decision

If two workers hold the same request, a unique claim in the datastore can let one perform the application change. The idempotency record and the change must agree after crash recovery. For external effects, the receiving component may need to accept the same identity or participate in coordination. RPC retry semantics explains the ambiguity the identity resolves. Database transactions supply a local atomic state contract.[1][2]

References

  1. Andrew D. Birrell and Bruce Jay Nelson, Implementing Remote Procedure Calls ↩
  2. MIT 6.5840, Distributed Systems: Course Readings ↩