Live data from Hacker News

Ask HN: Job Scheduling as a service

news.ycombinator.com

21–30 of 42 posts

Re: Ask HN: Job Scheduling as a service

#21

Earlier quoted context omitted.

http://mikehadlow.blogspot.com/2012/04/database-as-queue-ant...

The user doesn't need a queue though. They just need a process to find posts with a publish date of <= now that aren't published and publish them. That's a one line indempotent sql update statement in any decently architected application.

This was the other part of the comment I replied to:

Run cron on all your boxes, have them pull a job at a time from the database. Or shit, go full tilt with a clustered Redis job queue.

You're solving for the example but the original poster noted multiple jobs.

Re: Ask HN: Job Scheduling as a service

#22

Earlier quoted context omitted.

Yeah this works for cron jobs . Let me explain my requirement , say i have social media platform and users will schedule their post , and i need to schedule it in my scheduler and i have to persist in the databsae too . Because if the server is restarted all my scheduled jobs will be gone .. So i am looking for a hosted scheduler where i can send a rest API request with a webhook and a small payload . During the exec…

This sounds like a terrible way to achieve your goal. Save the future posts to the database with the required publish date/time. Run cron every $X minutes where $X is the smallest interval you allow (ie if you force publish date to be rounded to 5 minutes, run cron every 5 minutes) and check for "future posts" where the publish date This is pretty basic stuff and that you want to offload it to a 3rd party by capturin…

He's posting an example. He mentioned multiple jobs.

Re: Ask HN: Job Scheduling as a service

#23
AWS’s Cloud Watch Events take Cron expressions and can trigger various actions (Lambda, ECS task, SQS/SNS message, etc). http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/Wh... http://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-e... http://docs.aws.amazon.com/AmazonECS/latest/developerguide/s...

Re: Ask HN: Job Scheduling as a service

#28
post #2

You want cron, as a service? Shit on a stick doesn't anyone actually host anything themselves anymore?

I need a scheduler where i can dynamically ( via api ) schedule a job , with the admin UI to manage the jobs . I Think these are not part of application development and it can be offloaded to hosted services .

There are a lot of frameworks for this in various languages, depends on what you're doing - like sidekiq in ruby and hangfire in dotnet

https://github.com/mperham/sidekiq https://www.hangfire.io/

Re: Ask HN: Job Scheduling as a service

#29

Nomad by Hashicorp. You have to do just a little legwork to get it to call an API - just schedule a job that calls the appropriate curl command. When I'm explaining it to people, I explain it is a "distributed cron". You schedule a job either using the command line or via an API to the Nomad server and then it runs the job on any box that has the Nomad agent running and registered to the server. If you combine Nomad…

Nomad is probably a bit overkill for cron. It's a whole k8s alternative isn't it?
Post reply on HN