IronWorker CaaS Worker: SideKiq Setup

In this article, we will tell you the steps you need to set up SideKiq for IronWorker.

 

to try a free 14 day trial of Iron.io click here

Setup Outline:

  1. Create a new Ruby Project
  2. Write the code
  3. Run the worker
  4. Queue a message
  5. Notes
  6. Security
  7. Pros & Cons

Achieve Cloud Elasticity with Iron

Speak to us to find how you can achieve cloud elasticity with a serverless messaging queue and background task solution with free handheld support.

SideKiq pronounced Side-Kick is a lightweight Ruby library that provides jobs worker; it relays on Redis in the background as its database.

To implement the SideKiq worker server, you need to have a machine with Ruby and Redis installed on it.

The following steps will show the basic steps need to write your first SideKiq Worker server code.

1. Create a new Ruby project

Create a new directory and add “GemFile” with the following gem and run $ bundle to build your project

source "h​ttps://rubygems.org​"

gem "sidekiq"

2. Write the Code

Will write a simple code for client and server and define the worker “Perform” function, which executes based on queued job complexity in our use case example.

IronWorker CaaS Worker: SideKiq Setup

3. Run the worker

To start the server run $ bundle exec sidekiq -r ./worker.rb

IronWorker CaaS Worker: SideKiq Setup

Iron.io Serverless Tools

Speak to us to learn how IronWorker and IronMQ are essential products for your application to become cloud elastic.

4. Queue a message

Run the client
$ bundle exec irb -r ./worker.rb

Call Ourworker.perform_async message to queue a message and pass complexity
OurWorker.perform_async(“easy”)

On the running server console, you can see the asynchronous processing of the queued jobs and the time it takes depending on each one complexity

5. Notes

SideKiq is a lightweight tool for rapid implementation of Worker system if you are familiar with Ruby and can dedicate a server to run the worker and its dependencies

6. Security

SideKiq is compliant with GDPR

https://www.sideqik.com/sideqik-and-gdpr-compliance-a-guide

7. Pros & Cons

Pros of SideKiq is that it’s a super-fast worker tool with multithreading, automatically configured with Redis, suitable for the application-level worker solutions.

On the other side, it works only with Redis, and if Redis crashes while handling a queue data could be lost.

Unlike IronWorker, it requires a managed server to run and you have to use Ruby, and it requires several dependencies.

References:

https://www.sqlbot.co/blog/delayed-job-vs-sidekiq-which-one-should-you-choose

Unlock the Cloud with Iron.io

Find out how IronWorker and IronMQ can help your application obtain the cloud with fanatical customer support, reliable performance, and competitive pricing.

Leave a Comment





This site uses Akismet to reduce spam. Learn how your comment data is processed.