Q44: How do you design scheduled jobs at scale?
Store schedules durably and use a scheduler to enqueue due jobs rather than executing all work inside one timer process. Partition due-time scans, avoid duplicate enqueueing with unique run IDs, and have workers enforce concurrency and tenant quotas. Account for time zones, daylight-saving transitions, missed runs, retries, misfires, and long-running jobs. Track scheduled time separately from actual start and completion times.
Key Takeaways
- Persist schedules and enqueue work durably.
- Define misfire, timezone, retry, and duplicate-run semantics.