What to use for Ruby background tasks?

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com


Essentially all three perform the same task, executing background jobs, but go about it differently:

delayed_job uses your SQL database for storage and processes jobs in a single-threaded process. It’s simple to set up but the performance and scalability aren’t great. I would not use delayed_job for systems processing 100,000s of jobs/day.

resque uses redis for storage and processes messages in a single-threaded process. The redis requirement makes it a little more difficult to set up, compared to delayed_job, but redis is far better as a queue than a SQL database. Being single-threaded means that processing 20 jobs in parallel requires 20 processes, which can take a lot of memory.

sidekiq uses redis for storage and processes jobs in a multi-threaded process. It’s just as easy to set up as resque but more efficient in terms of raw processing speed. Your worker code does need to be thread-safe.