Scheduler (cron)
Amazon EventBridge Scheduler
Triggers work on a schedule: nightly reports, cleanups, reminders, reconciliation.
In a monolith
cron on the server
A crontab entry or in-app scheduler. With three app instances, each runs the job — three emails, unless you add a lock.
In a distributed system
One trigger, many workers
A single managed scheduler enqueues jobs and workers do the work: exactly one trigger, however many instances run.
On AWS
Amazon EventBridge Scheduler
Cron/rate schedules with time zones and retries that invoke Lambda, Step Functions, SQS or ECS tasks.
- EventBridge Scheduler$Managed one-off and recurring schedules
- ECS scheduled tasks$Run a container on a schedule
- Reach for it when
- Anything time-based: digests, expiry, reconciliation, retries of failed payments.
- What it costs you
- Duplicate runs if every instance runs cron
- Missed runs during outages — jobs must be able to catch up
- Everything at 00:00 creates a thundering herd
- When it dies
- Scheduled work silently doesn’t happen: reports aren’t sent, data isn’t cleaned. Rarely user-facing at first — which is why it needs alerts.
Interview follow-ups
Why not run cron on each app server?
N instances give N runs. You’d need a distributed lock; a single scheduler that enqueues one job avoids the problem.
How do you avoid everything firing at midnight?
Stagger with jitter and push work through a queue so workers process it at a steady rate.