← Lessons

quiz vs the machine

Gold1400

System Design

Deduplication Of Notifications

Collapsing repeated triggers so a user is not pinged many times for one event.

5 min read · core · beat Gold to climb

The duplicate problem

Events can fire more than once: a retry, two services reacting to the same change, or a noisy upstream. Without care a user gets three identical pushes for one comment.

Dedup keys

The fix is a dedup key that identifies the logical notification, often built from user, event type, and a target object id. The service records seen keys in a store with a time window.

  • If the key is new, send and record it.
  • If the key already exists within the window, suppress the duplicate.

Window choice

The dedup window balances safety and freshness. Too short lets duplicates through; too long suppresses a genuine second event that happens to look similar.

Coalescing

Beyond exact duplicates, coalescing merges several near identical events into one message, like five likes becoming people liked your post.

Key idea

Deduplication uses a key and a time window to suppress repeated triggers so one event yields one notification.

Check yourself

Answer to earn rating on the learn ladder.

1. What is a dedup key typically built from?

2. What is the risk of too long a dedup window?

3. How does coalescing differ from exact dedup?