← Lessons

quiz vs the machine

Platinum1750

System Design

Scheduling And Timezone Handling

Sending messages at a future time and at the right local hour for each user.

6 min read · advanced · beat Platinum to climb

Future and local sends

Some notifications are scheduled: a reminder at 9 am, a campaign next Tuesday. The service stores the intent and a scheduler releases it at the right moment.

Storing time correctly

  • Store absolute instants in UTC to avoid ambiguity.
  • Store the user timezone separately so local hour sends compute the correct UTC instant.
  • Beware daylight saving shifts that move local 9 am relative to UTC.

The scheduling engine

A common design is a time bucketed queue or a delay queue. A poller scans buckets due now and enqueues them for normal processing. This keeps the hot path simple.

Quiet hours

Many systems honor quiet hours, delaying non urgent sends that would land at night for the user, computed from their timezone.

Key idea

Scheduling stores UTC instants plus user timezone, releases due items from time buckets, and honors quiet hours for local delivery.

Check yourself

Answer to earn rating on the learn ladder.

1. Why store user timezone separately from a UTC instant?

2. How does a time bucketed scheduler work?

3. What are quiet hours?