4 ms·
Unless you designed Lambda, this is an arrogant tone. Sure, some of the things you mention are "better" or at least otherwise accomplished using event-triggere
by gamache 10y ago
Unless you designed Lambda, this is an arrogant tone.
Sure, some of the things you mention are "better" or at least otherwise accomplished using event-triggered Lambdas. But there's plenty of reasons why you might want to run a job that takes under 5 minutes on a schedule.
For instance, daily or weekly "digest" emails. Or a nightly stats job, where expensive-to-calculate yet not-immediately-critical queries are performed and the results stored or exported. These are things where you want them to happen at a certain time. Cron does that.
It's possible that customers didn't understand why AWS thought Lambdas were there, but that's irrelevant. Suddenly, Lambdas were there, and people thought of more use cases (SQS triggering, connection to API Gateway, etc) than AWS had implemented from the start. That's not the customers' fault for being creative.
- abrookewood 10y agoYep, I agree. If you rely on Cron/SCheduled Tasks, then you end up needing to run a server to run them. If Lambda did scheduled tasks, I'd have 1-2 boxes less in each environment ...
- lostcolony 10y agoNot sure based on your wording, but you -can- execute scheduled tasks with Lambda. It's a little tricky, as the actual configuration takes place in Cloudwatch (Cloudwatch Events). You also will be sure to want to set up a dead letter queue, and have that broadcast to an SNS topic that will email you, so that in the event the lambda fails, you'll be alerted.
- abrookewood 10y agoI've read about external services that will hit a SQS queue for you, but it would be a lot nicer if it was just supported natively in Lambda.
- lostcolony 10y agoNo, like, http://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html http://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-e... (and linked from that page, http://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-schedule-expressions.html http://docs.aws.amazon.com/lambda/latest/dg/tutorial-schedul... ) You can just set up "here's my cron string, run this function", and it will run that function when applicable. No external services, no SQS. Just a Cloudwatch event, that executes your lambda, at a set schedule.
- abrookewood 10y agoPerfect! Thanks. I'm going to retire some boxes ;)
- cagataygurturk 10y agoYou can still have regular boxes but turn on them when you need and turn off when your job is over. Let's say you can turn on an instance everyday at 10pm and tell your job to turn off the instance which it runs on when the job ends. It is possible to do it via AWS API.