← Lessons

quiz vs the machine

Gold1350

System Design

The Digest And Batching

Collecting many small events into one periodic summary instead of constant pings.

5 min read · core · beat Gold to climb

From stream to summary

Many notifications are low value individually but useful together. A digest collects events over a period and sends one combined message: your daily activity summary.

How batching works

  • Events are appended to a per user buffer keyed by digest type.
  • A scheduler fires on a cadence, hourly or daily, and flushes each buffer into one rendered message.
  • Empty buffers send nothing, avoiding pointless mails.

Triggers

A digest can flush on time, on a count threshold, or on both. A user with fifty events might get a digest early because the buffer filled.

Benefits and trade offs

Digests cut volume and fatigue but add latency, so they suit non urgent categories. Urgent events skip the buffer and send immediately.

Key idea

Digests batch many low urgency events into one periodic summary, flushing on time or count to reduce notification fatigue.

Check yourself

Answer to earn rating on the learn ladder.

1. What is the main purpose of a digest?

2. What can trigger a digest flush?

3. What is the trade off of batching?