News for hackers. Stuff that matters.
Re:Show HN: Posthook – Job Scheduling as a Service by cgenuity on Tuesday June 19, 2018 @09:56AM (#17346618)
Hello all! I built Posthook as a simple solution for web applications to schedule one-off tasks. It lets you schedule a request back to your application for a certain time, with an optional JSON payload.

It can be an alternative to running your own systems like Sidekiq, Celery, or Quartz and the operational overhead that comes along with them. Cron jobs and cloud provider tools like CloudWatch Events are also used for job scheduling but lack observability and may force you to frequently make expensive queries to your data store just to see if there is any work to do.

Questions and feedback are greatly appreciated :)

Re:Show HN: Posthook – Job Scheduling as a Service by mcintyre1994 on Tuesday June 19, 2018 @12:00PM (#17347875)
Neat! We've been doing something like this at work, and another simple solution (curious if your Google cloud infrastructure is built on something similar) is Azure Service Bus queues with a function app trigger.

Unlike AWS SQS, Azure SB queues can have items scheduled to be queued at an arbitrary time, see https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure..... SQS can only delay up to 15 minutes, so you have to implement your own hack to schedule for later than that.

And also unlike SQS, they can trigger a function so you don't have to deal with the logic to listen yourself - or even the transactional message handling, if the function fails the message is automatically re-queued.

Re:Show HN: Posthook – Job Scheduling as a Service by PretzelFisch on Wednesday June 20, 2018 @12:07AM (#17352512)
Aws just announced "ECS Daemon Scheduling" https://aws.amazon.com/about-aws/whats-new/2018/06/amazon-ec... It sounds promising.
Re:Show HN: Posthook – Job Scheduling as a Service by cgenuity on Tuesday June 19, 2018 @12:23PM (#17348052)
Thanks! I do heavily use Google Cloud Pub/Sub but it does not support scheduling items so I only schedule items when they are due for processing.
Re:Show HN: Posthook – Job Scheduling as a Service by navinsylvester on Wednesday June 20, 2018 @12:40AM (#17352621)
Wouldn't it be good to have your own pub/sub mechanism instead of relying on a third party like gce for a critical component. Take for example - https://github.com/grpc/grpc/issues/13327. It took them fair amount of time to fix that issue.
Re:Show HN: Posthook – Job Scheduling as a Service by ben509 on Tuesday June 19, 2018 @03:15PM (#17349490)
Interesting... AWS leaked that subscriptions to SQS are in the works, but it's good to see that Azure has that already.
Re:Show HN: Posthook – Job Scheduling as a Service by jwilsco on Tuesday June 19, 2018 @07:31PM (#17351156)
> AWS leaked that subscriptions to SQS are in the works

Interesting, where did you hear that?

Re:Show HN: Posthook – Job Scheduling as a Service by dyladan on Tuesday June 19, 2018 @11:20AM (#17347460)
I'm unclear about the part about expensive queries to the data store. What cron/celery/quartz job would require a check to the data store for a check that wouldn't need to be done with posthook? It seems like if work depends on a decision made with data from my data store, that doesn't change based on what I use as a timer for the task. I'm not sure that I see a clear value-add here.
Re:Show HN: Posthook – Job Scheduling as a Service by cgenuity on Tuesday June 19, 2018 @11:29AM (#17347572)
With a recurring job say every minute, the query triggered by the job to send out event reminders would be something like "get me all the events starting in one hour." With Posthook, you are able to start jobs only when needed and the query changes to something like "do I still need to send out a reminder for this event id."
Re:Show HN: Posthook – Job Scheduling as a Service by nautical on Tuesday June 19, 2018 @11:30AM (#17347587)
Hey cgenuity, Great to see the simplicity, I am working on a very similar product, launched couple of days back on HN (https://send.rest). Best of luck.

But have added couple of extra features in send.rest

1) Calling external APIs ( Think : pull data from Facebook while running this task in future and post data on my API or send SMS )

2) Reports and retries ( Try 3 times or send me sms its failing )

3) Recurrence ( Call this task every Monday 9:00 pm )

4) SMS and Emails comes along with them ( Send SMS or Email , pick any service as your backend )

I guess without some extra features it will be difficult to get a market acceptance.

Re:Show HN: Posthook – Job Scheduling as a Service by cgenuity on Tuesday June 19, 2018 @11:37AM (#17347641)
Thank you, good luck to you as well!

I've found that with scheduling tasks for the future it's important to do a final check before fulfilling the action, whether it's sending an email, push notification, etc. You don't want to send a reminder for an event that has been deleted, for example. That is why I have decided to keep the scope small and let developers make the final decision there.

Reports and retries are definitely things that I think add value though, and I have plans to expand on that.

Re:Show HN: Posthook – Job Scheduling as a Service by nautical on Tuesday June 19, 2018 @11:44AM (#17347704)
I also think there might be a market for this kind of product .. Great to see more people think on the same line .. Got some paid signups from last week also ..

You might be right about email/push, but it certainly comes handy if minimal config is required.

Re:Show HN: Posthook – Job Scheduling as a Service by ako on Tuesday June 19, 2018 @03:20PM (#17349538)
There are already mature products in this market, e.g. RunMyJobs: https://rmj.redwood.com/

This started out as a distributed cron over 20 years ago, available as a saas product for a few years already.

Re:Show HN: Posthook – Job Scheduling as a Service by nodesocket on Tuesday June 19, 2018 @12:21PM (#17348038)
With send.rest and using hook, can I specify a POST and POST data and custom request headers?
Re:Show HN: Posthook – Job Scheduling as a Service by nautical on Tuesday June 19, 2018 @01:16PM (#17348463)
send.rest supports HAR1.2 calls, you can technically call any API
Re:Show HN: Posthook – Job Scheduling as a Service by rglover on Tuesday June 19, 2018 @12:45PM (#17348223)
Thank you for this. I've been on the hunt for this exact service for awhile now but a lot of the options were lacking. Excited to give this a try.
Re:Show HN: Posthook – Job Scheduling as a Service by cgenuity on Tuesday June 19, 2018 @01:05PM (#17348377)
Thanks! Happy to provide value, feel free to use the live chat or the support email for any specific questions or requests you might have.
Re:Show HN: Posthook – Job Scheduling as a Service by nodesocket on Tuesday June 19, 2018 @11:31AM (#17347598)
Does Posthook support recurring scheduling (i.e. every 15 minutes)?

Also, is there retry logic? I.E. 3 retries, delay 60 seconds between retries?

Re:Show HN: Posthook – Job Scheduling as a Service by cgenuity on Tuesday June 19, 2018 @11:45AM (#17347710)
It does not support recurring scheduling at the moment.

Right now the retry logic is just one retry 5 seconds after the first failure. At which point the hook gets set to a failed status and failure notifications get sent out. Retries are tricky because depending on how the job is implemented they can cause more harm than good. So I plan to refine that more based on customer feedback.

Re:Show HN: Posthook – Job Scheduling as a Service by ben509 on Tuesday June 19, 2018 @03:25PM (#17349584)
> Retries are tricky because depending on how the job is implemented they can cause more harm than good.

Ah, yes, there's nothing like bringing capacity back online only to have it crushed by all your customers retrying at the same time.

AWS got bit hard by this[3] but there's a blog post[1] about it, which is linked to by the docs for their client software[2].

[1] https://aws.amazon.com/blogs/architecture/exponential-backof...

[2] https://docs.aws.amazon.com/general/latest/gr/api-retries.ht...

[3] https://aws.amazon.com/message/5467D2/ ... basically DynamoDB is a fundamental service for AWS and had implemented some new streams features. This all appeared to be working, but they were running closer to capacity than intended, and when a cluster went out this caused a cascading failure.

And see this which linked to that RCA: https://blog.scalyr.com/2015/09/irreversible-failures-lesson...

Re:Show HN: Posthook – Job Scheduling as a Service by nodesocket on Tuesday June 19, 2018 @12:15PM (#17347989)
Seems like allowing the user to specify retry logic (if any) covers the "tricky" pieces. Let the user define the number of retries and delay between.
Re:Show HN: Posthook – Job Scheduling as a Service by cgenuity on Tuesday June 19, 2018 @12:32PM (#17348125)
Agreed, thank you :). Added to the board.
Re:Show HN: Posthook – Job Scheduling as a Service by chaosprophet on Tuesday June 19, 2018 @11:48AM (#17347746)
What happens when you have a service outage? Do you directly mark the hooks as failed, or do you retry once after your service has been restored?
Re:Show HN: Posthook – Job Scheduling as a Service by cgenuity on Tuesday June 19, 2018 @11:58AM (#17347854)
If the service outage is on Posthook's side, they would be retried.

If the outage is on the customer's side, all hooks that were attempted during the outage would be marked as failed. I plan on adding a feature that will allow the developer to fire off again all failed hooks in a given time period.

Re:Show HN: Posthook – Job Scheduling as a Service by dosy on Wednesday June 20, 2018 @04:23AM (#17353514)
I just posted a scalable service that does support recurring scheduling ( every 15 minutes, as fast as every second, or long as every n months ). Show HN here: https://news.ycombinator.com/item?id=17353486
Re:Show HN: Posthook – Job Scheduling as a Service by jmvoodoo on Tuesday June 19, 2018 @01:58PM (#17348896)
I use cron-job.org for recurring hooks. It's not as developer friendly as posthook but it gets the job done.
Re:Show HN: Posthook – Job Scheduling as a Service by pbreit on Tuesday June 19, 2018 @03:38PM (#17349665)
What is the absolute easiest way to do this on your own machine?
Re:Show HN: Posthook – Job Scheduling as a Service by tazjin on Tuesday June 19, 2018 @06:04PM (#17350655)
systemd timers most likely. You already have systemd and unit configurations are small.

For dynamic stuff using normal systemd templates should work.