Notification batching system
Your task
Design a notification batching / digest system that prevents notification spam. Users generate events that notify others (comment, mention, like, assignment); a popular thread can produce hundreds of events for one user in minutes. Instead of 200 separate pushes/emails, the system should intelligently batch ('12 new comments on your post', 'Alice and 5 others mentioned you') with per-user, per-channel preferences (instant vs hourly vs daily) and respect quiet hours and timezones. How do you aggregate, batch, and deliver notifications without spamming users or dropping anything important?
It covers
- Digest
- Batching
- Preferences
- Fan out