Technical
Why I Replaced Cron With EventBridge Scheduler
Cron is the default for scheduled tasks, and for most solo operators it is still the right answer. But I had three cron servers drift into a maintenance tax I was tired of paying. Over the holidays I moved everything to EventBridge Scheduler and I will not go back. Here is the migration and what it actually cost.
Why Cron Was Hurting
- One instance per environment to patch and monitor
- Timezone surprises on DST transitions every year
- No built-in retries when a job failed
- Silent failures that only surfaced when a report was missing
- Package updates on the cron host that occasionally broke scheduled scripts
None of these are crises on their own. They add up to a slow bleed of weekend hours that I finally got tired of paying.
The New Setup
EventBridge Scheduler triggers a Lambda per job. Each job emits metrics and sends a failure to SNS. No servers, no patching, no DST surprises. The scheduler handles timezone conversion cleanly and the failure path is first-class rather than bolted on.
import boto3
client = boto3.client('scheduler')
client.create_schedule(
Name='daily-report',
ScheduleExpression='cron(0 9 * * ? *)',
ScheduleExpressionTimezone='America/New_York',
Target={ 'Arn': LAMBDA_ARN, 'RoleArn': ROLE_ARN },
FlexibleTimeWindow={ 'Mode': 'OFF' },
)The Real Cost Savings
The bill went up slightly, maybe two dollars a month in aggregate. The operational time dropped by two hours a month. That trade makes sense above any consulting rate I would consider. The math is basically free at any reasonable billable hour.
What Broke During Migration
Two jobs assumed they were running on a machine with specific local files. Moving to Lambda forced me to put those files in S3 and pull them on invocation. That was the hardest part of the migration and it took about two hours to fix for both jobs combined.
When Cron Still Wins
If you already have a running server that does other work, adding a cron entry is free. Do not move for the sake of moving. Move when the maintenance tax starts stealing your week. The EventBridge Scheduler docs cover the permissions setup which is the only tricky part of the migration.
RELATED READING
The Consulting Shift I Am Making In Year Two
After a year of writing and building, my consulting practice is changing shape. Shorter engagements. Sharper outcomes.
ReadThe Frontend Shift: Shipping Less JavaScript In Year Two
A year ago I reached for Next.js for everything. This year I often reach for nothing.
ReadThe Serverless Lesson I Would Write On A Sticky Note
After a year of shipping serverless projects, one rule explains most of the wins and all of the losses.
Read