Dynamodb can also be used as a one-time scheduler and I will say it will look also a lot simpler than this example. In dynamodb you can set TTL for a record. When the record expires it will fire event to your designated lambda. That's it. You simply write a record, wait for the record to expire and you get notified on your lambda.
S3 trickery: using it as a scheduler
21–30 of 44 posts
Re: S3 trickery: using it as a scheduler
#22All Cloudwatch would have to do is implement a recurrence = 1 feature but I’m guessing it's not a common enough use case.
Re: S3 trickery: using it as a scheduler
#23Re: S3 trickery: using it as a scheduler
#24CloudWatch Events already supports triggering Lambda functions on a cron schedule. You don't even need S3. This seems like a ton of work to basically invoke a function every n minutes.
If you want a reoccurring task then you are right, but if you want to run a one time task in a specific time in the future depending on internal logic, then it won't work
Re: S3 trickery: using it as a scheduler
#25Azure's service bus queue has a much better solution for this: you can schedule an item to appear in the queue at any future time. https://docs.microsoft.com/en-us/dotnet/api/microsoft.servic... Like Amazon's new SQS Lambda trigger you can then schedule a serverless function that's triggered by new items in the queue to have arbitrary scheduling of tasks. Using their Python API it's pretty nice: from datetime import…
Re: S3 trickery: using it as a scheduler
#26We're taking this serverless thing too far. We're coming up with elaborate overcomplicated schemes to accomplish simple tasks just so we can say "we're not running a server for this". Instead of doing the simple thing and running a server process that periodically checks some queue for tasks to execute, this "scheme" involves triggering a lambda function every minute, to do some IO operations on a distributed file st…
As far as using a queue, lambda also supports triggering based on a queue.
Re: S3 trickery: using it as a scheduler
#27This isn’t using S3 as a scheduler. Cloudwatch already supports cron and rate expressions, as the post alluded to. This is a hack to schedule something once. All Cloudwatch would have to do is implement a recurrence = 1 feature but I’m guessing it's not a common enough use case.
Re: S3 trickery: using it as a scheduler
#28Re: S3 trickery: using it as a scheduler
#29Azure's service bus queue has a much better solution for this: you can schedule an item to appear in the queue at any future time. https://docs.microsoft.com/en-us/dotnet/api/microsoft.servic... Like Amazon's new SQS Lambda trigger you can then schedule a serverless function that's triggered by new items in the queue to have arbitrary scheduling of tasks. Using their Python API it's pretty nice: from datetime import…
- set a CloudWatch scheduled rule to schedule a lambda.
- or set a rule to send an sns, subscribe a queue to the sns topic and subscribe a lambda to the queue.
Re: S3 trickery: using it as a scheduler
#30CloudWatch Events already supports triggering Lambda functions on a cron schedule. You don't even need S3. This seems like a ton of work to basically invoke a function every n minutes.
If you want a reoccurring task then you are right, but if you want to run a one time task in a specific time in the future depending on internal logic, then it won't work
https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/S...