Skip to content

CONCEPT Cited by 1 source

Duplicate execution prevention

Definition

Duplicate execution prevention is the discipline of ensuring that a given event or request is processed exactly once even when multiple consumers receive it (fan-out), retries occur (at-least-once delivery), or failover triggers re-processing. It combines two complementary mechanisms:

  1. Distributed locking โ€” prevents concurrent execution of the same event by multiple handlers.
  2. Idempotency records โ€” prevents re-execution of an event that was already successfully processed (post-facto deduplication).

The distinction matters: a lock alone doesn't prevent re-execution after the lock expires; an idempotency record alone doesn't prevent concurrent execution during the first processing attempt.

Techniques

Technique Prevents Limitation
Conditional write (lock) Concurrent duplicate execution Lock can expire if processing is slow
Idempotency key/token Re-execution after completion Doesn't prevent concurrent first attempts
Both combined All duplicate execution scenarios Requires globally-replicated store
Message deduplication (SQS FIFO) Duplicate delivery 5-minute window only; not cross-region

Seen in

Last updated ยท 590 distilled / 1,788 read