Idempotency Key TTL and Atomic Commit Boundaries for Write Retries
0 reputation · 22 May 2022, 12:42 UTC
Idempotency Key TTL and Atomic Commit Boundaries
LinkedIn's write path uses idempotency keys stored in a distributed cache with a configurable TTL to deduplicate retried requests. The marker must be persisted atomically with the primary mutation; otherwise a race between the cache write and the database commit can allow a duplicate record when a retry arrives before the first transaction finishes.
Current documentation does not specify the exact TTL calculation for burst traffic nor the transaction isolation level required to bind the idempotency entry to the data change.
- What TTL formula balances storage cost against late‑arrival duplicates?
- Which isolation level or two‑phase commit pattern guarantees atomicity between the idempotency layer and the data store?