TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Simple Pattern for Jobs and Crons on AWS

48 pointsby douglasfshearerabout 8 years ago

7 comments

Zombieballabout 8 years ago
An alternative would be to just use AWS lambda:<p>&gt; You can create a Lambda function and direct AWS Lambda to execute it on a regular schedule. You can specify a fixed rate (for example, execute a Lambda function every hour or 15 minutes), or you can specify a Cron expression.<p><a href="http:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;lambda&#x2F;latest&#x2F;dg&#x2F;with-scheduled-events.html" rel="nofollow">http:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;lambda&#x2F;latest&#x2F;dg&#x2F;with-scheduled-e...</a><p>It would remove the need of infrastructure for &quot;task workers&quot;. Although, depending on your stack &#x2F; setup, it of course may be easier to have your application tier double as a task worker due to complicated dependencies or startup times.<p>Additionally, I am not sure if everyone is aware but SQS does offer FIFO delivery with guaranteed once-only &quot;processing&quot;. There are some interesting caveats to this, definitely worth looking into though :)
评论 #14013948 未加载
评论 #14014368 未加载
luhnabout 8 years ago
I&#x27;ve used SQS for a simple job queue before. It works well and it&#x27;s nice not to have to worry about more infrastructure. To make things even better, Celery now has an SQS broker, which I&#x27;d like to try out.<p>I&#x27;ve also had success with an HTTP subscription in SNS for simple async jobs. Having your tasks be just another HTTP endpoint is really convenient. It&#x27;s not actually a task queue, but it&#x27;s often a good-enough substitute.<p>One frustration I&#x27;ve had with it is that Amazon signs SNS messages, but I can&#x27;t find a Python library for validating the signature. Not even AWS&#x27;s flagship API client (boto3) has the functionality.
评论 #14013930 未加载
reviconabout 8 years ago
As simple as this article is trying to make things, it still feels like it&#x27;s trying to re-create what elastic beanstalk workers already do out of the box... <a href="http:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;elasticbeanstalk&#x2F;latest&#x2F;dg&#x2F;using-features-managing-env-tiers.html" rel="nofollow">http:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;elasticbeanstalk&#x2F;latest&#x2F;dg&#x2F;using-...</a>
kralljaabout 8 years ago
You could also use `sqsd` (an Elastic Beanstalk worker environment) and avoid having to write any queue reading code.
nodesocketabout 8 years ago
Can&#x27;t wait until Google Functions[1] adds the ability to schedule and define recurring function calls.<p>[1] - <a href="https:&#x2F;&#x2F;cloud.google.com&#x2F;functions&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cloud.google.com&#x2F;functions&#x2F;</a>
WaxProlixabout 8 years ago
Something similar, and perhaps even simpler: Make a few SNS topics that lambdas can subscribe to - either one per method or one per method type, and then filter more in code - and push notifications to those from your service layer as needed to invoke async workflows. I&#x27;ve been doing this recently and it&#x27;s pretty pain-free.<p>Been meaning to look at Step Functions for a lot of this async work stuff, but haven&#x27;t had time yet (plus it&#x27;s nice to let these things mature a bit before diving in).
glumpyfishabout 8 years ago
For jobs that take longer than Lambda will allow, I use Datapipeline to run a ShellCommandActivity, which can run a bash script on an EC2 instance.
评论 #14015777 未加载