Member-only story
How to Use Sidekiq in Rails 6
A deep dive into a favourite background-processing system
Updated February 2021 for Ruby on Rails 6.1 and Sidekiq 6.1.3 while also adding a step-by-step guide for deploying to Heroku.

In September 2019, Sidekiq released version 6.x. Sidekiq comes in three flavours: the open-source version, Sidekiq Pro, and Sidekiq Enterprise.
Sidekiq uses threads to handle many jobs at the same time in the same process and is integrated tightly with Rails, although Rails isn’t a requirement. If you are looking for something language-agnostic, you should check out Faktory, also created by Mike Perham (the creator of Sidekiq).
At Organisely, we use Sidekiq for any long-running where the user doesn’t require immediate feedback. We also use Sidekiq for jobs that are likely to fail due to network errors and we want to leverage the automated retry mechanism.
Organisely sends a daily batch of text messages (using Twilio’s SMS API) as reminders for customers’ appointments. Although Twilio has insanely reliable APIs, network errors are inevitable and must be taken into account. We wrap each Twilio API call into a Sidekiq job that’ll retry if the API call is unsuccessful.