Deduplication

Recognizing a request or event you already handled so a retry does not charge, send, or update anything twice.

stop the same event running twiceignore duplicate webhookswhy did this charge happen twiceremove repeated requestsonly process each message oncemake the second click do nothingdedupededublication

See it

Live demo coming soon

What it is

Deduplication recognizes repeated requests, events, or records and lets only the first one cause an effect. The usual shape is simple: every operation carries a stable ID, and the consumer stores that ID under a unique constraint before doing work. Stripe webhook events expose an event `id` for exactly this kind of tracking.

Use it anywhere retries can repeat a side effect: charging a card, sending an email, incrementing inventory, or applying a queue message. It is the mechanism that makes at-least-once delivery safe enough to use in real systems.

Gotcha: checking and then inserting in two separate steps races. Two workers can both see 'not processed' and both continue. Claim the key atomically with a database unique constraint or Redis SET NX, and keep the record long enough to cover the sender's retry window. Also define what counts as the same operation. Identical JSON is not a reliable identity when timestamps or field order can change.

Ask AI for it

Deduplicate Stripe webhooks by event.id. Before dispatching an event, insert its ID into a PostgreSQL table with a UNIQUE constraint and perform that insert plus the business mutation in one transaction. Treat a unique-violation as an already processed success, never as a 500. Verify the Stripe-Signature first, retain deduplication rows for the full replay window, and add a concurrency test where two workers receive the same event simultaneously.

You might have meant

idempotencyidempotency keywebhookwebhook signature verificationmessage queue