3

I'm in the process of developing a Rails app that I plan on subsequently deploying to Heroku. I've never run apps on Heroku (outside of the free simple app) so I have some questions on a few things on how I should architect some aspects of my app to run.

I want a service to run on a schedule to check for inactive users to send a 'we haven't seen you in a while' type of email. Would this just be it's own worker dyno in Heroku? Or would that be integrated into the web app as a background job of sorts?

In relation to that, I will have a worker dyno that will handle sending account confirmation emails, among other random emails, would it make sense to have that operation be coupled with the process above? Or would it have to be a completely separate dyno?

I've done plenty of this type of work in .Net hence some of my confusion on this switch to Rails.

1 Answer 1

2

The "Heroku way" looks to be the use of Heroku's custom clock processes, coupled with a Ruby gem to interface with the clock process such as Clockwork.

(There is also a way to run less strict scheduled jobs, the Heroku Scheduler. ("Scheduler is a best-effort service. There is no guarantee that jobs will execute at their scheduled time, or at all. Scheduler has a known issue whereby scheduled processes are occasionally skipped. An alternative to Heroku Scheduler is to run your own custom clock process."))

1
  • That does seem like what I was looking for. I'm assuming that Clockwork gem would run under it's own worker dyno as it looks like it's being setup as it's own separate app from the web app. Commented May 28, 2013 at 14:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.