on time.
A little lesson in system design

Millions of reminders.
One smart scheduler.

When every reminder has its own deadline, how do you know what to send next? Explore two ways to keep time at scale.

See it in action

Scheduler playground

Watch reminders find their moment

Interactive demo
Choose a strategy

SIMULATED TIME  00:00 / 01:00
5× speed

Each strategy keeps its own progress. New reminders are added to both. Reset both restores the original set. Switching strategies pauses playback.

This is a simulated 60-second example. It assumes ideal processing and sends no real notifications.

First, the challenge

Why is this a problem?

A handful of reminders is easy. Millions of reminders require a more thoughtful way to find what’s due.

Scanning wastes work

Repeatedly checking every reminder means doing lots of work, even when nothing is due.

Threads don’t scale forever

Giving every reminder a separate waiting thread consumes memory and other resources.

Time is the key

The scheduler needs an efficient way to find the next deadline, then do the work when it arrives.

Two useful approaches

Different paths, same goal.

The right choice depends on how precise your reminders need to be—and how much scheduling work you can afford.

01   /   ORDERED BY DEADLINE

Min-heap

Think of a priority queue: the earliest deadline is always at the top, ready to be picked up.

Find earliestO(1)
Add / remove earliestO(log n)
Best forMore precise deadlines
Trade-offMore work per insertion
02   /   GROUPED BY TIME

Timing wheel

Think of a clock with buckets: reminders are grouped into slots and processed together.

Add to a slotO(1), with direct insertion
Process a slotO(k) for k reminders
Best forHigh volume, flexible timing
Trade-offTiming depends on slot size

Here, n is the number of queued reminders and k is the number in a slot. These are data-structure costs; sending notifications and displaying statistics require additional work. The playground shows one 60-second cycle, rather than a continuously rotating production wheel. A hierarchical timing wheel uses multiple levels to handle near and distant deadlines. Real systems also need persistence, retries, and a plan for coordinating workers.

Don’t check everything.
Make time work for you.

Neither approach guarantees exact delivery: system load, failures, and network delays can add lateness.
Made with Aii CloudReport