Rail's has lots of solutions for background jobs. One of these is a brilliant Gem called Sidekiq, which we have written about before on Sitepoint.
Sidekiq is great and can solve most developer needs. It is especially useful as it takes over the heavy lifting from Rails. However, it has a few shortfalls:
- If you are not a Pro user ($750 per year) and your process crashes, you will lose your jobs.
- If your job load increases, you will need a more powerful version of Redis which costs more money and resources.
- You need to host its dashboard in order to monitor what is happening with your jobs.
*
Another approach you may want to consider for processing queued jobs is Shoryuken, which works in conjunction with Amazon's SQS (Simple Queue Service). This is a basic store of messages that you can process later via Shoryuken workers. These workers then work outside of the main Rails processes. With SQS and Shoryuken, you create a queue for your workers to use and these workers cycle through the jobs until the queue is empty.
Continue reading %Quickly Process API Requests with Shoryuken and SQS%
by William Kennedy via SitePoint
No comments:
Post a Comment