News for hackers. Stuff that matters.
Re:Writing a cron job microservice with Serverless and AWS L... by gamache on Monday January 30, 2017 @06:07PM (#13525943)
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.

Re:Writing a cron job microservice with Serverless and AWS L... by abrookewood on Monday January 30, 2017 @10:08PM (#13527198)
Yep, 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 ...
Re:Writing a cron job microservice with Serverless and AWS L... by lostcolony on Monday January 30, 2017 @10:15PM (#13527228)
Not 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.
Re:Writing a cron job microservice with Serverless and AWS L... by abrookewood on Tuesday January 31, 2017 @05:36AM (#13529377)
I'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.
Re:Writing a cron job microservice with Serverless and AWS L... by lostcolony on Tuesday January 31, 2017 @05:51PM (#13536152)
No, like, 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-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.

Re:Writing a cron job microservice with Serverless and AWS L... by abrookewood on Tuesday January 31, 2017 @09:18PM (#13537608)
Perfect! Thanks. I'm going to retire some boxes ;)
Re:Writing a cron job microservice with Serverless and AWS L... by cagataygurturk on Wednesday February 01, 2017 @12:18PM (#13542634)
You 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.